Lec3 - Introduction to JavaScript Flashcards

(7 cards)

1
Q

“Use Strict” mode

A

Using strict mode promotes early error detection, enhances code reliability, and encourages best practices in JavaScript development

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

JavaScript Syntax

A

Variables: var (global), let (local), or const (local and immutable)
Arrays: [] (elements don’t need to be the same type
Objects: {} (most things in JavaScript are objects)
Functions: ‘function’ and ‘return’ keywords

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

JavaScript Primitive Types and nuances

A

-All regular numeric values are stored as floating-point numbers
-String backticks allow for nested variables
-Boolean Falsy (undefined null, false, 0, NaN, ‘’). Everything else truthy

=== For exactly equal (including types)

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

JavaScript Functions

A

Functions are first class entities and can be stored and exchanged the same way as any variable

Lambda functions: can construct functions without naming them (useful for compact code that is only referenced once)

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

Destructuring

A

Allows expansion on an array or object
E.g.
Const variables = [1, 2, 3, 4];
[a, b, …rest] = variables;
# a=1, b=2, rest = [3,4]

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

Synchronous programming

A

Operation blocking: While an operation is being processed, nothing else can happen. Code easy to understand but may lead to inefficiencies

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

Asynchronous Programming

A

Effectively handle potential block operations such as: reading/writing files, fetching resources from a server
Need to get notified when an asynchronous operation completes (using callbacks, events, and promises)

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