JavaScript P1 Flashcards

1
Q

JavaScript is related to Java T/F

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

JavaScript is not______, it is ________.

A

compiled, interpreted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Loosely-typed

A

variable types are assigned at runtime

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Undefined (keyword)

A

declared but not defined

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Not Defined (keyword)

A

not defined or declared

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Primitive Datatypes

A
undefined
boolean
number
string
bigint
symbol
null
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

falsy types

A
-0
0
undefined
false
" "
NaN
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

truthy types

A

true
1
object
everything else that isn’t falsy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

null

A

special primitive type having additional usage for its value: if object is not inherited, then null is shown

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

typeof()

A

returns the type of the ‘thing’ in ()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

type coercion

A

changes the type of a variable when it is defined in another location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Arrays

A

variable in length and type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Functions: Three Invocations

A

Function form
Constructor form
Method form

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Function form

A

“this” refers to the global object

no overloading

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Constructor form

A

“this” refers to the object being made

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Method form

A

“this” refers to the object its based off

17
Q

Scopes: three types

A

Function Scope
Global Scope
Shadowing

18
Q

Function Scope

A

Things that are declared inside a function
use keyword var
if you don’t use ver, creates implicit global

19
Q

Global Scope

A

anything declared outside of a function

accessible anywhere

20
Q

Shadowing

A

if multiple variables have this same name, JS will use the one that was declared most recently

21
Q

____ does not escape blocks, ____ does

A

“let”, “var”

22
Q

Hoisting

A

moving declarations to top of scope

23
Q

var

A

a way to declare a variable
able to be reassigned
scope can be global or local

24
Q

let

A

preferred way to declare variables
able to be reassigned
scope is restricted to the block they were declared in

25
Q

const

A

variable can not be reassigned after declaration

scope is restricted to the block they were declared in

26
Q

prototype

A

mechanism by which JS objects inherit features from one another

27
Q

Arrow Notation

A

syntactically compact alternative to a regular function expression

28
Q

closure

A

an inner function that has access to the outer function variables