MCQ's Questions

(Web Designing and Publishing)

Chapter-5

  1. Q1. JavaScript was originally developed under the name
    A. ActionScript
    B. Sencha
    C. Oak
    D. Mocha
  2. Q2. JavaScript global variable is
    A. declared outside the function
    B. declared with the window object
    C. declared inside the function
    D. None of these
  3. Q3. Which of the following is true about JavaScript variable?
    A. JavaScript variable names are case-sensitive
    B. JavaScript variable names should not start with a numeral
    C. You should not use any of the JavaScript reserved keywords as a variable name
    D. All of the above
  4. Q4. The expression of calling (or executing) a function or method in JavaScript is called
    A. Primary expression
    B. Functional expression
    C. Invocation expression
    D. Property access expression
  5. Q5. How do you create a function in JavaScript
    A. function:myfunction()
    B. function myfunction()
    C. function=myfunction()
    D. function.myfunction()
  6. Q6. Which is the correct syntax for Angular Module?
    A. var variable_name = angular.module("app_name", []);
    B. var variable_name = angular.modules("app_name");
    C. var variable_name = angular.module();
    D. var variable_name = new module();
  7. Q7. What do we use to comment in JS?
    A. //
    B. //* * //
    C. ||
    D. \\* * /
  8. Q8. Why JavaScript Engine is needed?
    A. Both compiling & interpreting the JavaScript
    B. Parsing the JavaScript
    C. Interpreting the JavaScript
    D. Compiling the JavaScript
  9. Q9. What is the correct JavaScript syntax to change the content of the HTML element?
    A. document.getElement("p").innerHTML = "Hello World!";
    B. document.getElementById("demo").innerHTML = "Hello World!";
    C. document.getElementByName("p").innerHTML = "Hello World!";
    D. #demo.innerHTML = "Hello World!";
  10. Q10. In JavaScript, what is a block of statement?
    A. Conditional block
    B. Block that combines a number of statements into a single compound statement
    C. Both conditional block and a single statement
    D. Block that contains a single statement
  11. Q11. Which directives binds application data to the HTML view?
    A. ng-app
    B. ng-model
    C. ng-bind
    D. ng-state
  12. Q12. Which of the following is not a mouse event?
    A. onclick
    B. onmousescroller
    C. onmouseover
    D. onmousemove
  13. Q13. Which of the following is true about Angular JS expressions?
    A. Expressions behave in same way as ng-bind directives
    B. Expressions are used to bind application data to html
    C. Expressions are written inside double braces like {{expression}}
    D. All of these
  14. Q14. Which of the following is used to share data between controller and view in Angular JS?
    A. Services
    B. Model
    C. factory
    D. None of these
  15. Q15. The "Function" and "var" are known as in Javascript
    A. Declaration statements
    B. conditional statements
    C. variable and function statements
    D. None of these
  16. Q16. ng-app directive is used
    A. To start an AngularJs application
    B. To End an AngularJs application
    C. Both of the above
    D. None of the above
  17. Q17. Consider the below div tag content statement, how to print the value of "UserName"?
    A. UserName
    B. {{UserName}}
    C. {UserName}
    D. {_UserName}
  18. Q18. Which of the following directive is used to bind the value of HTML controls to application data?
    A. ng-app
    B. ng-init
    C. ng-model
    D. ng-hide
  19. Q19. Which is the correct syntax to call an external JavaScript file in the current HTML document?
    A. <script src="test.js"></script>
    B. <script href="test.js"></script>
    C. <import src="test.js"></import>
    D. <script link="test.js"></script>
  20. Q20. What will be the output of the following JavaScript code?
    A. 10
    B. 15
    C. 5
    D. 50
  21. Q21. Find the only statement in the following that is correct:
    A. Javascript interpreter processes program written in Java.
    B. Javascript interpreter processes the commands in a Script written in Javascript.
    C. Java and Javascript are almost similar.
    D. Javascript cannot be embedded in HTML.
  22. Q22. Which of the following is not valid Angular Js Filter?
    A. email
    B. lowercase
    C. orderby
    D. currency
  23. Q23. Which of the following is an IF statement in JavaScript?
    A. ifi=5
    B. if (i == 5)
    C. if i == 5 then
    D. All of these
  24. Q24. Which of the following expressions is true?
    A. {expression}
    B. {{expression}}
    C. {{expression}}}
    D. [expression]
  25. Q25. Which directive initializes an AngularJS application?
    A. ng-init
    B. ng-app
    C. ngSrc
    D. ng-Start
  26. Q26. Which of the following statements define Arrays in JavaScript?
    A. It is an ordered list of values.
    B. It is an ordered list of objects.
    C. It is an ordered list of string.
    D. It is an ordered list of functions.
  27. Q27. What is the use of "defer" attribute?
    A. It defers rendering of HTML page.
    B. It defers script execution until the page has been rendered.
    C. It defers rendering of css attributes.
    D. It is only for internal scripts.
  28. Q28. Which directive initializes application data in Angular Js?
    A. ng-init
    B. ng-app
    C. ngSrc
    D. ng-Start
  29. Q29. Which of the following statements is false?
    A. Async and defer attributes of script tag execute before the DOMContentLoaded event.
    B. Defer executes each script sequentially.
    C. Asyns executes each script when it is ready.
    D. All older browsers supports sync attribute.
  30. Q30. Which of the following javascript functions are used to convert nonnumeric values into numbers?
    A. Number()
    B. parseFloat()
    C. parseInt()
    D. All of the above
  31. Q31. Which statement specify correct difference between var and let keywords in JavaScript?
    A. var defines a variable while let defines a constant.
    B. There is no such major difference between them.
    C. The value of a variable declared with var can be changed while the value of a variable declared with let cannot be changed.
    D. var defined function scoped variable while let define block scoped variable.
  32. Q32. Which of the following code is most efficient?
    A. Code 1
    B. Code 2
    C. Both Code 1 and Code 2
    D. Cannot Compare
  33. Q33. Which of the following is the correct way to declare a variable.
    A. x var=100;
    B. var x:100;
    C. var x=100;
    D. var x =! 100;
  34. Q34. What is the output of the following JavaScript code.
    A. 16
    B. Compilation Error
    C. 88
    D. None of the above
  35. Q35. For which of the following purpose JavaScript is designed for?
    A. To style HTML pages
    B. To perform server-side scripting operation
    C. To execute query related to DB on server
    D. To add interactivity to HTML Pages
  36. Q36. Javascript is used to _ the user input at browser before submitting the page to server for further processing.
    A. Authenticate
    B. Authorize
    C. Validate
    D. Develop
  37. Q37. What type of value gets printed if we add the following two variables?
    A. Long
    B. Text
    C. Integer
    D. Number
  38. Q38. What are the three important manipulations done in a for loop on a loop variable?
    A. Updation, Incrementation, Initialization
    B. Initialization, Testing, Updation
    C. Testing, Updation, Testing
    D. Initialization, Testing, Incrementation
  39. Q39. What is the output of the following JavaScript code?
    A. "30"
    B. 5*6
    C. 30
    D. "5*6"
  40. Q40. Which of the following Attribute is used to include External JS code inside your HTML Document.
    A. Script
    B. src
    C. Link
    D. Rel
  41. Q41. What is the alternate name for JavaScript?
    A. LimeScript
    B. ECMScript
    C. Coffee Script
    D. ECMAScript
  42. Q42. What is the correct way to write a JavaScript array?
    A. var colors=1=(“red”),2=(“green”),3=(“blue”)
    B. var colors=(1:“red”,2:“green”,3:“blue”)
    C. var colors=“red”,“green”,“blue”
    D. var colors=[“red”,“green”,“blue”]
  43. Q43. Which one of the following is not considered as an error?
    A. Division by zero
    B. Missing of Bracket
    C. Syntax error
    D. Missing of semicolons
  44. Q44. The external JavaScript file must contain <script> tag.
    A. True
    B. False
    C. May be
    D. Sometimes
  45. Q45. Which of the following directives allows one to use form?
    A. ng-app
    B. ng-form
    C. ng-controller
    D. ng-bind
  46. Q46. What is the output of the following JavaScript code?
    A. 0
    B. undefined
    C. 1
    D. NaN
  47. Q47. The correct syntax to write “Sky is blue” in JavaScript is:
    A. jscript.write(“Sky is blue”)
    B. document.write(“Sky is blue”)
    C. print(“Sky is blue”)
    D. jscript.print(“Sky is blue”)
  48. Q48. Why event handlers are needed in JS?
    A. Allows JavaScript code to alter the behavior of windows
    B. Add innerHTML page to the code
    C. Change the server location
    D. Performs handling of exceptions and occurrence
  49. Q49. Choose the correct JavaScript syntax to change the content of the following HTML code.
    A. document.getElementById(“OLEVEL”).innerHTML=“A LEVEL”;
    B. document.getElement(“OLEVEL”).innerHTML=“A LEVEL”;
    C. document.getElementById(“OLEVEL”).innerHTML=A LEVEL;
    D. document.getId(“OLEVEL”)=“A LEVEL”;
  50. Q50. Among the given statements, which statement defines closures in JavaScript?
    A. JavaScript is a function that is enclosed with the references to its inner function scope.
    B. JavaScript is a function that is enclosed with references to its lexical environment.
    C. JavaScript is a function that is enclosed with the object to its inner function scope.
    D. None of these