JavaScript Flashcards

1
Q

How do you round the number 7.25, to the nearest integer?

A

Math.round(7.25)

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

How do you find the number with the highest value of x and y?

A

Math.max(x, y)

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

How can you detect the client’s browser name?

A

navigator.appName

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

Is JavaScript case-sensitive?

A

Yes

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

Question 11: Which of the following is an example of anonymous function in JavaScript?

var myFunc = function(){ };
function(){ };
var myFunc = (){ };
All of the above.

A

var myFunc = function(){ };

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

Question 13: What is eval() in JavaScript?

A

The eval() function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script.

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

A variable declared without var keyword inside a function will become _______ variable.

local
global
block
undefined

A

global

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