🧪 Javascript Design Patterns MCQ Quiz Hub

Javascript Design Patterns Mcq Question Set 2

Choose a topic to test your knowledge and improve your Javascript Design Patterns skills

1. The amount of scenario interaction is related to which of the following metrics?




2. Which of the following is correct?




3. Which type of JavaScript language is ___




4. Which of the following is the correct output for the following JavaScript code: varx=5,y=1 var obj ={ x:10} with(obj) { alert(y) }




5. Which one of the following also known as Conditional Expression:




6. In JavaScript, what is a block of statement?




7. When interpreter encounters an empty statements, what it will do:




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




9. In the following given syntax of the switch statement, the Expression is compared with the labels using which one of the following operators? switch(expression) { statements }




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




11. Which one of the following is the correct way for calling the JavaScript code?




12. Which of the following type of a variable is volatile?




13. Which of the following option is used as hexadecimal literal beginning?




14. When there is an indefinite or an infinite value during an arithmetic computation in a program, then JavaScript prints______.




15. n the JavaScript, which one of the following is not considered as an error:




16. Which of the following givenfunctions of the Number Object formats a number with a different number of digits to the right of the decimal?




17. Which of the following number object function returns the value of the number?




18. Which of the following function of the String object returns the character in the string starting at the specified position via the specified number of characters?




19. In JavaScript the x===y statement implies that:




20. Choose the correct snippet from the following to check if the variable "a" is not equal the "NULL":




21. Suppose we have a text "human" that we want to convert into string without using the "new" operator. Which is the correct way from the following to do so:




22. What will be the output of the following JavaScript code? functioncomparison() { int number=10; if(number==="10") returntrue; else returnfalse; }




23. Find out the correct output of the following given piece of code from the given options: functionfun() { int y=10; char z=10; if(y.tostring()===z) returntrue; else returnfalse; }




24. See the given code of JavaScript and choose the correct output from the following: var string1 = "40"; varvalueinit=50; alert( string1 +intvalue);




25. In JavaScript, what will be used for calling the function definition expression:




26. Which of the following one is the property of the primary expression:




27. Consider the following snippet of JavaScript code: var text ="testing: 1, 2, 3";// Sample text var pattern =/d+/g// Matches all instances of one or more digits Which one of the following statement is most suitable to check if the pattern matches with the sting "text".




28. Which one of the following is used for the calling a function or a method in the JavaScript:




29. The "new Point(3,2)", is a kind of _______ expression




30. Which one of the following operator is used to check weather a specific property exists or not:




31. Which one of the following is an ternary operator:




32. "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_____.




33. Which of the following is the correct output for the following JavaScript code: function display1(option) { return(option ? "true" : "false"); } bool ans=true; console.log(display1(ans));




34. Which one of the following is correct output for the following given JavaScript code: var obj= { length:20, height:35, } if('breadth' in obj === false) { obj.breadth = 12; } console.log(obj.breadth);




35. Which one of the following is correct output for the following given JavaScript code: functionheight() { var height=123.56; var type =(height>=190)?"Taller":"Little short"; return type; }




36. Which one of the following is correct output for the following given JavaScript code: string X= "Good"; string Y="Evening"; alert(X+Y);




37. Which one of the following is correct output for the following given JavaScript code: functionoutputfun(object) { var place=object ?object.place: "Italy"; return "clean:"+ place; } console.log(outputfun({place:India}));




38. Which one of the following is correct output for the following given JavaScript code: <p id="demo"></p> <script> functionourFunction() { document.getElementById("demo").innerHTML=Math.abs(-7.25); } </script>




39. Which one of the following is correct output for the following given JavaScript code: <p id="demo"></p> <script> function Function1() { document.getElementById("demo").innerHTML=Math.cbrt(792); } </script>




40. Which one of the following is correct output for the following given JavaScript code <p id="demo"></p> <script> functionmyFunction() { document.getElementById("demo").innerHTML=Math.acos(0.5); } </script>




41. What we will get if we compare the "one" with "8" using the less than operator ("one"<8)?




42. Which one of the following is known as the Equality operator, which is used to check whether the two values are equal or not:




43. Which one of the following operator returns false if both values are equal?




44. In a case, where the value of the operator is NULL , the typeof returned by the unary operator is___.




45. Which one of the following is correct output for the following javascriptcode: var string1 = "Letsfindout"; var intvalue = 40; alert( string1 + intvalue );




46. Which one of the following is not a keyword:




47. What are the three important manipulations for a loop on a loop variable?




48. f the following piece of JavaScript code is executed, will it work if not, what kind of possible error can occur? function fun(o) { for(;o.next; oo =o.next); return o; }




49. What is the role of the "continue" keyword in the following piece of JavaScript code? while (x !=0) { if(x ==1) continue; else x++; }




50. Which one of the following is not considered as "statement" in the JavaScript?