What key word is used to create a variable in JavaScript?
if (condition) {
code
}
The name of this function:
function addToJeopardyScore() { }
addToJeopardyScore
How do you get the length of a string?
.length
What is the name of a variable that can only take the values true or false
boolean
How do I get the element "code" out of the array:
arr = ["learning", "to", "code", "is", "fun!"]
arr[2]
Name 2 types of data in Javascript
Number, string, boolean, array, object
What symbol(s) can I use to return true if ONE or BOTH boolean expressions are true, and false otherwise? ex. expr1 __ expr2
||
How do I add the item 2 to the array
arr =[1, 3, 1]
arr.push(2)
other acceptable answers
What is the index of the "w" in "Hello world!"
6
What will the following statement print?
If (true || false) {print("Hello ")}
If (true && false) {print("World")}
else {print("!")}
Hello!
Name one way to remove an element from an array
.pop(), .shift(), .slice()
What function call would I use to get only the "love" out of var s = "I love Javascript!"
s.slice(2, 6)
What will x be equal to at the end of this statement?
x = ""
if (x) {x += "Python"}
if (!x) {x += "JavaScript"}
if (x.length > 6) {x += " is the best"}
else if (x.length < 100) {x += " is the worst"}
else {x += "!"}
JavaScript is the best
how might I combine the following arrays into a single array with all of the names?
var names1 = [“Jennie”, “Rose”]
var names2 = [“Jisoo”, “Lisa”]
var allNames = names1.concat(names2)