Flash Cards

Touch the Questions to Reveal the Answers

In a class constructor, to attach a variable to an instance we put ___. in front of it.

this

A function that exists inside a class is called a ____?

method

In a class, parameters go in the ___?

constructor

Assuming "colors" is an array; colors.length will be ... ?

how many items are in colors

(x===0) ? x = 1 : x = 2; is an example of a ___ ?

ternary conditional

let x = 3; x += 2; What is x?

5

An extended class...

is a class that adds methods and/or variables to a parent class

let x = 0; x = 4; What is x?

4

In a switch case, the last line should be...?

break;

let x = 2; let y = 2; x += y; What is x?

4