JavaScript MCQ Quiz Hub

JavaScript MCQ Set 2

Choose a topic to test your knowledge and improve your JavaScript skills

1. An expression that can legally appear on the left side of an assignment expression.” is a well known explanation for variables, properties of objects, and elements of arrays. They are called ___________




2. What will be the equivalent output of the following JavaScript code snippet? x = ~-y; w = x = y = z; q = a?b:c?d:e?f:g;




3. What will be the output of the following JavaScript code? function output(option) { return (option ? “yes” : “no”); } bool ans=true; console.log(output(ans));




4. What will be the output of the following JavaScript code? function height() { var height = 123.56; var type = (height>=190) ? "tall" : "short"; return type; }




5. What will be the output of the following JavaScript code? string a = ”hi”; string b =”there”; alert(a+b);




6. What will be the output of the following JavaScript code? function output(object) { var place=object ? object.place : “Italy”; return “clean:”+ place; } console.log(output({place:India}));




7. What will be the output of the following JavaScript code? <p id="demo"></p> <script> function myFunction() { document.getElementById("demo").innerHTML = Math.abs(-7.25); } </script>




8. What will be the output of the following JavaScript code? <p id="demo"></p> <script> function myFunction() { document.getElementById("demo").innerHTML = Math.cbrt(125); } </script>




9. What will be the output of the following JavaScript code? <p id="demo"></p> <script> function myFunction() { document.getElementById("demo").innerHTML = Math.acos(0.5); } </script>