JavaScript 1
Arrays
Data Types
Objects
Functions
100

What do you use in Javascript to store information for later use?

Variables

100

what do you use in JavaScript to store multiple values?

Arrays

100

What is an array?

A list of items.

100

what do you use in JavaScript to store key/value pairs?

Objects

100

How do you call/invoke a function

functionName()

200

what does the DOM stand for?

DAILY DOUBLE!

Document Object Model

200

can you change the indexes of a array that is assigned as a const variables?

Yes

const arr = [1,2,3,4]

arr[2] = 'pizza'

200

What can be stored into an array?

Strings, Numbers, Objects, Arrays, pretty much anything

200

What are the two ways we can access an objects properties?

DAILY DOUBLE!

dot notation obj.property

bracket notation obj['property']

200

What is the difference between arguments and parameters?

an argument is a value passed in when we invoke a function. parameters are placeholders for those values

300

What is the difference between const and let?

const is a constant, cannot be changed

let allows us to assign the variable to a new value

300

What data type is an Array?

Object

300

Accessing an array is known as?

Bracket Notation arrName[index]

300

How can I change the name of the property of this object?

const obj = {

name: 'Joe'

}

obj.name = 'John'
300

What does the return do?

Sends a value back from the function

400

Name two methods to select HTML Elements?

document.getElementById()

document.querySelector()

document.querySelectorAll()

document.getElementsByClassName()

400

How can you access the last item of an array

DAILY DOUBLE!

arrName[arrName.length - 1]

400

How can we access the last item on an array?

arrName.length - 1

400

How can I access the keys of an Object?

Object.keys(objName)

400

Find the Bug

const count = 0;

const scoreEle = document.getElementById('score')

function count(){

count++

return count

}

scoreEle.textContent = count()

Assignment to constant

Change const to let

500

Write a for loop to count to 5?

let count = 0

for (let i = 0; i <= 5; i++){

count++

}

500

Name 4 array methods

.pop .push .unshift . shift etc.

500

const test = [1,'two',3,{count:4},[5,6,[7]]]
How can I grab 7?

test[4][2]

500

Access the treasure

const puzzle = {

left: [{right: {

up: ['treasure']}}]

}

puzzle.left[0].right.up[0]

500

What is subtractLife() returning?

let life = 100

function subtractLife(){

    let life = 85;

    if (life > 100) {

        return life - 20

    }

}

subtractLife()

85


M
e
n
u