Assessment wanted for Arrays 4 skill test_Dinesh

Hi,
I have completed a test and I need a review for the code.
Here are my code pen link and task link

Thank you in Advance!!!

This is also correct!

If you like, here’s an additional question:
If you have to build a new array from an existing array with a certain condition, you can use Array.prototype.filter(). Can you rewrite your solution to use filter() instead of a normal loop?

Cheers,
Michael

1 Like

Cool, your suggestion saved me some lines and made the code look less clunky.
Here you can see it for yourself. Thank you so much for your insights, they help me a lot. Also, I know that you’re a busy man, so I request you to take as much time as you want to reply to my queries.

Thank you again dear Sir,
Dinesh

1 Like

That was exactly what I meant. I like how clean the solution looks when using filter(). There are more similar array methods. The most commonly used are probably:

Appreciated! I’m trying to not let people wait too long, but sometimes it takes a few days. :grin: I’m really happy that so many learners are coming back with more tasks. It’s a good sign that my answers seem to be useful. :blush:

Michael

1 Like