General Flashcards

1
Q

ES6

A

ECMAScript 6, also known as ES6 and ECMAScript 2015, was the second major revision to JavaScript.

JS 2015 = ES6 = ECMAScript 2015

ECMAScript is the standard, JS is implementation

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

Babel

A

ES6 has to be implemented by the browser to be able to run it. Since it’s not always the case - we need to run our ES6 code through Babel, which transpiles it down to something else like ES5 code

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

run something at intervals (timer)

A

setInterval(function_reference, every_millisec)

setInterval(this.tick, 1000) //once every second

when started for the first time, the method will wait every_millisec and only then start function_ref

so to avoid this - you have to call the function once before setInterval

this.tick()
setInterval(this.tick, 1000) //once every second

the method returns a timer object

const timer = setInterval(this.tick, 1000) 
to stop the timer we call

clearInterval(timer);

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