Thank you for the reply. I’m sorry if I’m being dense here, but, on my understanding the issue starts before progressing to step 2. In all the previous exercises you have had to submit the partial answer to move on to the next step (or submit the solution to all steps at once). Is the suggestion that I should have done all three parts at once and submitted them all together? If so ignore the following.
Step 1 reads:
Log each element from rapperArray
in a for
loop with the iterator variable rapperArrayIndex
.
Step 2 reads:
After the for
loop, log the string "And if you don't know, now you know."
to the console. Note: since there’s a single quote character, '
, in our string, we can use double quotes around the string to make sure character prints.
When I submitted the code:
const rapperArray = [“Lil’ Kim”, “Jay-Z”, “Notorious B.I.G.”, “Tupac”];
// Write you code below
for (rapperArrayIndex = 0; rapperArrayIndex < (rapperArray.length); rapperArrayIndex ++) {console.log(rapperArray[rapperArrayIndex])}
as the answer/submission to step 1, the automatic evaluator did not allow me to progress to step 2 upon running that code. However it seemed to me to achieve the result the question was asking for, i.e., logging the following output:
Lil’ Kim
Jay-Z
Notorious B.I.G.
Tupac
The code I would want to submit for all three parts would be as follows:
const rapperArray = [“Lil’ Kim”, “Jay-Z”, “Notorious B.I.G.”, “Tupac”];
// Write you code below
for (rapperArrayIndex = 0; rapperArrayIndex < (rapperArray.length); rapperArrayIndex ++) {console.log(rapperArray[rapperArrayIndex])
if (rapperArray[rapperArrayIndex] === ‘Notorious B.I.G.’) {
break;
} }
console.log (“And if you didn’t know, now you know”)
This seems to log the expected result so I am at a loss as to why the automatic evaluator did not accept that input.