At my 30s I found out that there was a developer inside a Political Science Graduated.
I've been COO an CMO for 4 years but I decided to persue my dream and become a Front-end developer:)
Location
Elche, Alicante, Spain
Education
Certificate of Higher Education for Web Applications Development & Degree in Political Science
I was about to ask what's the difference between forEach, which I tend to use a lot and these other methods. Honestly, I use forEach because I learnt it first and I didn't feel need to learn others haha.
Are these methods a better practice or a refactor method?
forEach is an Array method just like Array.prototype.map and Array.prototype.filter. The difference between forEach and other Array methods is that unlike "map" and "filter", "forEach" does not return the array it always returns undefined.
I hope this cleared the confusion.
Thanks for bringing this up in the comments. 😊
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I was about to ask what's the difference between forEach, which I tend to use a lot and these other methods. Honestly, I use forEach because I learnt it first and I didn't feel need to learn others haha.
Are these methods a better practice or a refactor method?
For of came with ES2015 and is currently a better practice :
Hey Nadine,
forEach is an Array method just like Array.prototype.map and Array.prototype.filter. The difference between forEach and other Array methods is that unlike "map" and "filter", "forEach" does not return the array it always returns undefined.
I hope this cleared the confusion.
Thanks for bringing this up in the comments. 😊