Bug in iterators - map


#1

https://www.codecademy.com/courses/learn-javascript-iterators/lessons/javascript-iterators/exercises/map?action=lesson_resume&course_redirect=introduction-to-javascript

Maybe this is a bug, but according to the console my function prints the first character of each string, but the lesson won’t let me continue. It’s telling me that I’ll be refactoring later, so I didn’t use the arrow function yet. Any ideas?


Learn JavaScript: Iterators 3/7 - .map()
#2

I’ve actually had this issue with every page on the Iterators lesson so far, so I’m not sure what’s going on…

Edit: Filed a bug report.


#3

I’ve had this issue too! Gonna keep filing bug reports on each page… I spent so long trying to figure out what was wrong with my code so it’s good to know it is actually a bug and not just me.


#4

I wish there were better directions. I had to have it generate code to figure out the right method to use. You need to use .charAt appended to the end of animal with an index of zero (0).

So, line 5 should read return animal.charAt(0);

For more information about .charAt, check out the website below:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt


Explanation on how to do this