YDKJS get started Flashcards

1
Q

what is a transpiler?

A

it is a tool that converts js code to an old compatible version

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

what is an example of a transplier?

A

babel

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

what do u use to be compatible with old syntax?

A

transpiler

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

what do u use to be compatible with new methods?

A

polyfill

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

is js interpreted?

A

kind of but more of a compiled language as we know static errors before actually running the code which means the script is parsed before it’s ran

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

how does js files share their funcionality?

A

1 - global scope

2 - modules

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

what are the types of js values?

A

1 - primitive

2 - objects

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

what are the primitive types of js?

A
1 - strings
2 - int
3 - bigInt
4 - undefined
5 - null
6 - symbol
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is the difference between var and let?

A

let is block scoped

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

what happens when you change the value inside a CONST array?

A

you can change the value but you cannot change the array itself

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

what is the difference between function declaration and function expression?

A
1 - function declaration happens during compile time
function name(){
}
2 - function expression happens during interpretation time
var
const
let
             name = function (){
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

how does js treat functions?

A

as a sub-type of object namely ‘function’ and can be assigned

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

what does === mean?

A

check for type and value

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

what are the values that === lies about?

A

1 - Nan === Nan
2 - 0 === -0 -> checks for object.is()
3 - object types

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

why does === does not work for objects?

A

because it checks for the reference meaning the address no the values inside the object

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

what does == do?

A

changes the type in some cases before comparison

17
Q

what does == do for number and string?

A

changes the type of string to it’s number and compare

18
Q

what does == do for two strings?

A

checks them alphabetically

19
Q

what is … used for?

A

spreading and gathering

for spreading an array it returns another array of each value

var greeting = "Hello world!";
var chars = [ ...greeting ];
chars;
// [ "H", "e", "l", "l", "o", " ",
// "w", "o", "r", "l", "d", "!" ]
20
Q

what is a closure?

A

Closure is when a function remembers and continues to access variables from outside its scope, even
when the function is executed in a different scope.