Link to task:
Link to the examples I would like to be assessed:
Array 1: https://codepen.io/fadildairo/pen/NWwGEWO
Array 2: https://codepen.io/fadildairo/pen/BamovyX
Link to task:
Link to the examples I would like to be assessed:
Array 1: https://codepen.io/fadildairo/pen/NWwGEWO
Array 2: https://codepen.io/fadildairo/pen/BamovyX
Hi @FadilDairo
Great job on this tasks! Here are my comments:
lastItem
variable contains the last index. How could you change the code to get the last item?let newArray = bird;
. You could just do eBirds.push(bird);
If you like I have an additional question:
In task 4 you could also use the filter()
array method instead of a for..of
loop. How could this be achieved?
Have a nice day,
Michael
Hi Michael,
I refactored the code. Kindly reassess.
Great improvements!
In task 4 you could even shorten the line to const eBirds = birds.filter(bird => bird.startsWith('E'));
because comparing a boolean value with “true” an returning the result is the same as just returning the boolean value itself.