Javascript Function MCQ Questions and Answers

Javascript Function MCQ Questions and Answers

Home | Javascript | Javascript Function

Javascript Function MCQ Questions and Answers : We provide quiz questions on Javascript Function where you can learn lots of objective questions with answers and you can also download pdf of javascript.

Page: 1/2

1) The function definitions in JavaScript begins with

2) Consider the following code snippet

function printprops(o)
{
for(var p in o)
console.log(p + ": " + o[p] + "\n");
}

What will the above code snippet result ?

3) When does the function name become optional in JavaScript?

4) What is the purpose of a return statement in a function?

5) What will happen if a return statement does not have an associated expression?

6) A function with no return value is called

7) Consider the following code snippet

function hypotenuse(a, b)
{
function square(x)
{
return x*x;
}
return Math.sqrt(square(a) + square(b));
}

What does the above code result?

8) Which of the following is the correct code for invoking a function without this keyword at all, and also too determine whether the strict mode is in effect?

9) Which is an equivalent code to invoke a function m of class o that expects two arguments x and y?

10) Consider the following code snippet

o.m(x,y);

Which is an equivalent code for the above code snippet?