typed programming language Facts: • Javascript is the world’s most popular programming language • The browser Chrome is made partially with Javascript! • If you have used Google.com, means you have used Javascript. • There are ~13 million JS developers in the world 🤔
is a string a = 123 // this is a number a = 3.14 // this is also a number a = true // this is a boolean a = undefined // this is an undefined, a default 'empty' type a = null // this is a null, a programmed 'empty' type
let animals = [] // prefilled arrays can also be declared as animals = ["Cat", "Dog"] let newAnimal = "Dragon" animals.push(newAnimal) // Push appends the array: ["Dragon"] animals.length // Length returns the amount of element inside the array: 1 animals.pop() // Pop removes the last element: [] animals = ["Cats", "Dogs", "Dragons"] let newAnimals = ["Sheep", "cow"] const zoo = [...animals, ...newAnimal] // spread operator spreads the content of the array: ["Cats", "Dogs",.. "Cow"] zoo.map(animal => console.log(animal)) // iterates the array and returns the iterated element zoo.forEach(animal => console.log(animal)) // iterates the array but only passes the iterated element as an arg. zoo.filter(animal => animal === "Dogs") // iterates the array and returns the element that returns true