Basic concepts Flashcards

Grasp javascript at a general low level of understanding

1
Q

What are the 7 datatypes in Javascript and how do we categorize them and why that way?

A
Six data types that are primitives:
Boolean
Null
Undefined
Number
String
Symbol (new in ECMAScript 6)
and Objects

non-primitive data types are simply called “objects” because they are created, rather than predefined

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

What is strict mode and how do we initiate it?

A

Eliminates some JavaScript silent errors by changing them to throw errors.
Fixes mistakes that make it difficult for JavaScript engines to perform optimizations: strict mode code can sometimes be made to run faster than identical code that’s not strict mode.
Prohibits some syntax likely to be defined in future versions of ECMAScript.

‘use strict’;

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

How do we initiate strict mode in javascript?

A

‘use strict’;

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

Strict mode, what does it do?

A

It enforces a set of rules that allow for better programming and avoiding errors.

Strict mode does not allow global variables to be declared without the use of let, const, and/or var.

Strict mode you cannot delete variables.

You can’t declare multiple variables with the same names

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