💡 HOMEWORK for next time: https://github.com/HackYourFuture-CPH/JavaScript/blob/main/javascript2/week2/homework.md
💪 Prep for next session: https://github.com/HackYourFuture-CPH/JavaScript/blob/main/javascript2/week3/preparation.md
What are events for?
How to use events?
Common events
Resources & exercises
Array methods are used to manipulate arrays.
Some most used array methods are:
map
:** creates a new array populated with the results of calling a provided function on every element in the calling array.forEach
:** looks a lot like map, but it doesn’t return anything (= the result is always undefined). It only executes a function to each item of the array without creating a new array.filter
: creates a new array filled with elements that pass a test provided by a function.sort
: sorts the elements of an array.Resources & exercises
Compact alternative to the regular function() {}
→ Mostly “syntactic sugar”
Scopes → this?!
Resources & exercises