// Declare and initialize the variables for exercise 1 here: let engineIndicatorLight = "red blinking"; let spaceSuitsOn = true; let shuttleCabinReady = true; let crewStatus = spaceSuitsOn && shuttleCabinReady; let computerStatusCode = 200; let shuttleSpeed = 15000 // BEFORE running the code, predict what will be printed to the console by the following statements: if (engineIndicatorLight === "green") { console.log("engines have started"); } else if (engineIndicatorLight === "green blinking") { console.log("engines are preparing to start"); } else { console.log("engines are off"); } let tool = 'marker'; // Use short circuit evaluation to assign writingUtensil variable below: let writingUtensil = tool || "pen"; console.log(`The ${writingUtensil} is mightier than the sword.`); let stopLight = 'yellow'; if (stopLight === 'red') { console.log('Stop!'); } else if (stopLight === 'yellow') { console.log('Slow down.'); } else if (stopLight === 'green') { console.log('Go!'); } else { console.log('Caution, unknown!'); }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter