JavaScript Flashcards

1
Q

What is JavaScript?

A

A text-based programming language used both on the client and server sides that allows you to makes webpages dynamic. It calculates, manipulates, and validates data. It can update and change html and css.

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

What is ECMAScript?

A

European Computer Manufacturers Association Script. A JavaScript standard standard intended to ensure the interoperability of web pages across different browsers

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

What are the data types in JavaScript?

A

JS data types have 2 categories: primitive and non primitive. The 7 primitive are: number, Boolean, string, null, undefined, and symbol. The 1 non-primitive is object.

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

Null vs Undefined

A

Undefined is a variable that refers to something that doesn’t exist and the variable isn’t defined by anything. Null is defined but is missing a value.

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

What is type coercion?

A

The explicit or implicit conversion of values from one data type to another. Implicit is when JS coerces the value type to the expected under the hood. Explicit is done manually. For example string value to an equivalent number value. There are 3 types of conversion: number, string, and Boolean.

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

What are closures?

A

A closure is a function having access to the parent scope, even after the parent function has closed.

A combination of a function bundled together with references to its surrounding states. Important because it gives access to an outer functions scope from an inner function.

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

What is prototypal inheritance?

A

The ability to access object properties from another object. It is used to add new properties and methods to an existing object constructor.

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

What are template literals and arrow notation?

A

Literals delimited with backtick (‘) characters allowing for multiline strings string interpolation with embedded expressions, and special constructs called tagged templates.

String interpolation: to create strings by doing substitution of placeholders

=> Arrow function provides and alternate way to write a short syntax for functions

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

What is hoisting?

A

The process of moving all declarations of functions, variables, or classes to the top of their scope before executing the code. This ensures all functions are safely declared before being used in the code regardless of whether their scope is global or local.

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