Im not sure what it means when it says “In the previous exercise, we called the .forEach() method and learned that it returns undefined.” When I run:
let fruits = ['mango', 'papaya', 'pineapple', 'apple'];
// Iterate over fruits below
console.log("I want to eat a" + fruitItem);
I want to eat amango
I want to eat apapaya
I want to eat apineapple
I want to eat aapple
That doesn’t look undefined to me, but then again im a total noob. Could someone please explain to me how .ForEach() returns undefined?
At the end, there is no } ) ; symbols to “show” the end of the code. This means that it will show up as undefined, because the code “has no end”.
I guess you can go ahead and at the
Please, add another space between the last “a” and the ". this will make the code show up as
“I want to eat a mango” etc etc.
Is it the SCT that is giving your that message, or is it a console error? I’m not able to reproduce this issue.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.