JavaScript Questions

0 votes, 0 avg
614

JavaScript Questions

1 / 15

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

function printArray(a) 
{
     var len = a.length, i = 0;
     if (len == 0)
        console.log("Empty Array");
     else 
     {
// do-while loop in javascript
         do 
         {
             console.log(a[i]);
         } while (++i < len);
     }
}

2 / 15

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

3 / 15

3. how can you write into HTML output using javascript?

4 / 15

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

5 / 15

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

let x = "10";
    let y = + x;
    
    document.write(typeof y);

6 / 15

6. 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);
}

7 / 15

7. The correct syntax to write "Hello World" in javascript.

8 / 15

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

9 / 15

9. Which handler is triggered when the content of the document in the window is stable and ready for manipulation?

10 / 15

10. Which variable is an implicit parameter for every function in javascript?

11 / 15

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

12 / 15

12. JavaScript objects are written with _____.

13 / 15

13. Which of the following values is not a Boolean false?

14 / 15

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

15 / 15

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

var quiz=[1,2,3];
var js=[6,7,8];
var result=quiz.concat(js);
document.writeln(result);

Your score is

0%

Written by Shubhranshu Shekhar, who has trained 20000+ students in coding.

Scroll to Top