JavaScript Questions

0 votes, 0 avg
600

JavaScript Questions

1 / 15

1. What is the code for getting the current time?

2 / 15

2. Which of the following is the language of javascript?

3 / 15

3. What will be the output of the following JavaScript code?

var arr = [7, 5, 9, 1];  
var min = Math.min.apply(null, arr);  
document.writeln(min);

4 / 15

4. Which object in Javascript doesn’t have a prototype?

5 / 15

5. What will happen, if the following JavaScript code is executed? var count =0;
while (count <10) { console.log(count); count++; }

6 / 15

6. What will be the output of the following JavaScript code If these is a p tag element with id="demo"?

var numbers1 = [4, 9];
var numbers2 = numbers1.map(myFunction);
document.getElementById("demo").innerHTML = numbers2;
function myFunction(value, index, array)
{
return value * 2;
}

7 / 15

7. Which of the following is not a vaid javascript variable.?

8 / 15

8. What does … operator do in JS?

9 / 15

9. Will the following JavaScript code work?

var js = (function(x) {return x*x;}(10));

10 / 15

10. The "function" and " var" are known as:

11 / 15

11. Where is Client-side JavaScript code is embedded within HTML documents?

12 / 15

12. Which of the following is a valid function to truncate number of full minutes between two time stamps?

13 / 15

13. When the switch statement matches the expression with the given labels, how is the comparison done?

14 / 15

14. What will be the output of the following code snippet?


var a = "Scaler";
var result = a.substring(2, 4);
document.write(result);

15 / 15

15. Any time you include javascript variable in HTML document, you must enclose those lines inside a _______

Your score is

0%