JavaScript Flashcards
How do you round the number 7.25, to the nearest integer?
Math.round(7.25)
How do you find the number with the highest value of x and y?
Math.max(x, y)
How can you detect the client’s browser name?
navigator.appName
Is JavaScript case-sensitive?
Yes
Question 11: Which of the following is an example of anonymous function in JavaScript?
var myFunc = function(){ };
function(){ };
var myFunc = (){ };
All of the above.
var myFunc = function(){ };
Question 13: What is eval() in JavaScript?
The eval() function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script.
A variable declared without var keyword inside a function will become _______ variable.
local
global
block
undefined
global