I can’t seem to pass this test, and I’m pretty sure it’s because the ratings numbers need to be converted back into strings. Does anybody know how to do that? The toString() method doesn’t seem to be working.
Try filtering first and then doing the mapping. Don’t know if the order matters, but it worked for me that way.
Also, do you need the return within map? Could that be affecting the code somehow? I honestly don’t know, but when mappin I just did it like this:
Thanks! Yes, I think you’re right. From the research I’ve done it looks like filtering first, then returning the filtered array as a new array with map is probably going to work.
Okay, check this out. I did a Google search and found something called the unary plus operator, which forces JavaScript to treat a string like a number. The cool thing about it is it doesn’t change the string to a number, but instead ignores the string state in order to perform mathematical operations. Here’s my new, updated, working beautifully, code: