DEV Community

samgotowka
samgotowka

Posted on • Edited on

1

End of Phase 1 at Flatiron

When I Started learning the basics of JavaScript I thought it was going to be pretty straight forward and not require too much practicing but wow I was wrong. The hardest thing for me to learn by far was array iterations. For example I thought the .filter() method was as simple as someConst.filter(isPrime) and whatever else you wanted filtered, but no its like:
const array= [1,2,3,4,5,6,]
function isPrime(num) {
for (let i = 2;num > i; i++) {
if(num % i === 0){
return false;
}
}
}
console.log(array.filter(isPrime)); // [1,3,5]
when I first saw this I was so lost and didn't really understand what was going on but now after really going back and re-reading the documents from my class and looking things up all over the internet I now know that it is basically creating a new variable then seeing if there is a remainder if there isn't, it does not get logged.

well I guess that's all for my first blog about how I was completely wrong about how much work is needed to truly understand what you are coding and how to make it work the way its intended.

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay