What key word is used to create a variable in JavaScript?
let
if (condition) {
code
}
The name of this function:
function addToJeopardyScore() { }
addToJeopardyScore
What is the following operator: -
Subtract
How do you get the length of a string?
.length
What is the name of a data type that only has 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]
What is the following operator: +=
Add and Reassign
Name 2 types of data in Javascript
Number, string, float, 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 following operator: **
The exponent operator
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 is the following operator: !
not operator
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.length > 6) {x += "Javascript is the best"}
else if (x.length < 100) {x += " is the worst"}
else {x += "!"}
JavaScript is the best
What would the following code print:
let names1 = [“Jennie”, “Rose”]
console.log(names1[1].toUpperCase())
ROSE
What is the following operator: --
auto decrement