This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const readline = require("readline"); | |
| const rl = readline.createInterface({ | |
| input: process.stdin, | |
| output: process.stdout | |
| }); | |
| let questionBank = ["1 + 1", "1 + 2", "2 + 3", "2 + 2", "3 + 3"]; | |
| let answerBank = ["2","3","5","4","6"]; | |
| let questionIndex = Math.floor(Math.random() * 5); | |
| let answerIndex = Math.floor(Math.random() * 5); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //CHAPTER 3 Array and Objects | |
| arr1= new Array("purple", "orange", "red"); | |
| arr2 = ['red', 'pink', 'blue']; | |
| arr3 = new Array(10); | |
| arr4 = [10]; | |
| arr5 = ["Dog", 46, true, 45.455]; | |
| const arr6 = ["I am Divine", "I am Esther"]; | |
| shopList = ["Milk", "Bread", "Apples"]; | |
| names = ["dan","ben","john","esther","el","ese", "dee", "lola"] | |
| console.log(arr3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //CHAPTER ONE AND CHAPTER TWO | |
| console.log(Math.floor(Math.random() * 100)); | |
| // comments | |
| /* comment */ | |
| let firstWord = "Hi World"; | |
| let printWord = 'Javascript learn ${firstword}'; | |
| console.log(printWord); | |
| let language = "JavaScript"; |