JavaScript the complete guide from beginner + advanced Flashcards

1
Q

what is javascript?

A

it is a dynamic , weakly typed programming language that is compiled at runtime

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

how is javascript executed?

A

with javascript engine like V8 on chrome or spidermonkey on firefox

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

what are the steps of the execution of javascript?

A

1 - parse
2 - compile to machine code
3 - execute machine code

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

what do we mean by weakly typed?

A

we don’t have to declare the variable type

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

what do we mean by dynamic

A

type of variable can change at run time (code can change at runtime )

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

what is the difference between ECMAscript and javascript?

A

javascript is an implementation of ECMAScript like jscript or Actionscript

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

can u access variables outside the function?

A

yes functions can access global variables

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

can u access the variables inside of a function?

A

no local scopes cannot be accessed from outside the function

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

can u redecalare the same variable?

A

no u can only declare it once but u can declare it in global scope and then redeclare it in another local scope

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

what is shadowing?

A

creates a new variable on a different scope - this variables does not overwrite or remove the global variable by the way - both co-exist.

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

why do we use indirect function calls like calling a function without parenthesis?

A

Sometimes however, you don’t want to execute the function immediately. You rather want to “tell JavaScript” that it should execute a certain function at some point in the future like with an event listener

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

what is the difference between indirect function call and direct function call?

A

direct function call executes the function immediately but indirect function call tells java script to just register the function in case we call it in a particular situation

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

what happens when u call a function without parenthesis in just an empty line?

A

nothing happens and no error will occur

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

how to convert from string to int or float?

A

parseInt and parseFloat

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