/* JS Documentation */ // Variables types // new let = dynamic values const = constant values // old (var = dynmic values ) let mySky = "blue"; const myNumber = 8927349278934; // 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 function 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 brackets on the myObjects variable (Object array) enable the targeting of the index number, starting at 0 */ //myObjects[2].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) })