JavaScript Documentation // Variables // New let = dynamic values const = constant values // Old (var = dynamic values) let mySky = "blue"; const myNumber = 9489348534598; // DATA TYPES Numbers: 1234 Text (string): "Hello" Boolean: true or false Arrays: ["car", "house", "cat"] let lightsOn = true; function makePizza() { //making pizza alert ("making pizza...") } //calls the functions makePizza(); function displayWeather(weatherData) { console.log("the current weather is: " + weatherData) } displayWeather("sunny") // EVENTS let myShoe = document.getElementById("shoe"); myShoe.addEventListener("click", function(){ myShoe.style.rotate = "3deg"; console.log("tilting the shoe..."); }); // LOGGING console.log("Hello console - App is starting...") console.log(myNumber) // this will output 8927349278934 console.log("this is the value of myNumber: " + myNumber) // this will output: this is the value of myNumber: 8927349278934 /* For Loops */ const myObjects = document.querySelectorAll(".box"); // square bracket on the myObjects variable enable the // // targetting of the index number, starting at 0 // myObjects[0].addEventListener("click", myClickFunction) for (let i = 0; i < myObjects.length; i++) { //do stuff } myObjects.forEach(function (item, index, array) { //do stuff item.addEventListener("click" , myClickFunction) })