JavaScript Questions

0 votes, 0 avg
194

JavaScript Questions

1 / 15

1. What is the central concept of JavaScript memory management?

2 / 15

2. Which function is used to serialize an object into a JSON string in Javascript?

3 / 15

3. Which of the following is not considered as an error in javascript?

4 / 15

4. Which JavaScript method is used to access an HTML element by id?

5 / 15

5. How are windows, tabs, iframes, and frames treated according to client-side javascript?

6 / 15

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

var a = "hello";
var sum = 0;
for(var i = 0; i < a.length; i++) {
   sum += (a[i] - 'a');
}
print(sum);

7 / 15

7.

Which one of the following is correct output for the following given JavaScript code if there is a p tag with id=demo ?
functionourFunction()
{
document.getElementById("demo").innerHTML=Math.abs(-7.25);
}

8 / 15

8. Arrays in JavaScript are defined by which of the following statements?

9 / 15

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

a = [1, 2, 3, 4, 5];
print(a.slice(2, 4));

10 / 15

10. Which is the correct syntax to call an external JavaScript file in the current HTML document?

11 / 15

11.

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

12 / 15

12. Which of the following global variables is used to get parameters?

13 / 15

13. What are the two parts of JavaScript libraries?

14 / 15

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

var cars = ["Honda","Hyundai","Mahindra"];
 
 var result = cars.shift();
 
 document.writeln("Result: ", cars);

15 / 15

15. Which object serves as the global object at the top of the scope chain?