Week 5 Day 3 - March 5, 2025
Functions
Today we learned about functions. I found the lesson extremely helpful and it cleared up a lot of things for me. It cleared up the arrow notation and the different ways of writing it (let newFunction = (num) => num * 2). We learned about multiple functions including:
- map - this creates a new array from an exisiting array and applies the function to each of the elements in the first array.
- filter - this takes each element in an array and applies a conditional statement against it.
- reduce - this reduces an array of values down to just one value.
The homework involved doing assignments on code Academy and free code camp. On code academy, they had us make some projects that involved a sleep calculator and a rock paper scissors game. It involved creating functions and using if/else statements for different conditions. I found the ai analyzer feedback to be extremely helpful because it showed me more efficient ways to create my code.