m2-r5 mcq questions with answers - MCQs: M2-R5.1

m2-r5 mcq questions with answers

M2-R5 MCQ Questions with Answers | O Level July 2025 Preparation

Prepare for your O Level Web Designing MCQs and boost your O Level July 2025 preparation with this handpicked list of M2-R5 MCQ questions. These include both JavaScript MCQ and AngularJS MCQs curated from previous NIELIT M2-R5 questions to help you revise thoroughly.

  1. Which company developed JavaScript?
    A) Mozilla
    B) Netscape
    C) Google
    D) IBM
    Answer: B) Netscape
  2. Which symbol is used for comments in JavaScript?
    A) //
    B) #
    C) <!– –>
    D) **
    Answer: A) //

  3. What is the correct syntax for referring to an external script called “abc.js”?
    A) <script name="abc.js">
    B) <script src="abc.js">
    C) <script href="abc.js">
    D) <script link="abc.js">
    Answer: B) <script src="abc.js">

  4. How do you write “Hello World” in an alert box?
    A) msg(“Hello World”);
    B) alertBox(“Hello World”);
    C) msgBox(“Hello World”);
    D) alert(“Hello World”);
    Answer: D) alert(“Hello World”);

  5. Which of the following is not a JavaScript data type?
    A) Undefined
    B) Number
    C) Float
    D) Boolean
    Answer: C) Float

  6. Which function is used to parse a string to int in JavaScript?
    A) Integer.parse()
    B) parseInt()
    C) getInt()
    D) parseInteger()
    Answer: B) parseInt()

  7. Which keyword is used to define a function in JavaScript?
    A) define
    B) function
    C) method
    D) void
    Answer: B) function

  8. JavaScript is a ___ language.
    A) Compiled
    B) Interpreted
    C) Assembly
    D) Machine
    Answer: B) Interpreted

  9. Which method removes the last element from an array?
    A) pop()
    B) remove()
    C) shift()
    D) delete()
    Answer: A) pop()

  10. How do you create an array in JavaScript?
    A) let arr = (1,2,3);
    B) let arr = {1,2,3};
    C) let arr = [1,2,3];
    D) let arr = <1,2,3>;
    Answer: C) let arr = [1,2,3];

  11. Which built-in method returns the length of the string?
    A) size()
    B) length()
    C) index()
    D) len()
    Answer: B) length

  12. What is the output of typeof NaN?
    A) number
    B) string
    C) undefined
    D) object
    Answer: A) number

  13. Which operator is used for strict equality in JavaScript?
    A) =
    B) ==
    C) ===
    D) !==
    Answer: C) ===

  14. What is the default value of a JavaScript variable?
    A) null
    B) 0
    C) undefined
    D) empty
    Answer: C) undefined

  15. What does isNaN("text") return?
    A) true
    B) false
    C) 0
    D) error
    Answer: A) true

  16. Which of the following methods can be used to round a number?
    A) Math.floor()
    B) Math.round()
    C) Math.ceil()
    D) All of the above
    Answer: D) All of the above

  17. Which function is used to print in the console?
    A) print()
    B) write()
    C) console.log()
    D) echo()
    Answer: C) console.log()

  18. Which symbol is used for single-line comments in JavaScript?
    A) /*
    B) #
    C) //
    D) <!–
    Answer: C) //

  19. Which method adds new items to the end of an array?
    A) push()
    B) append()
    C) insert()
    D) join()
    Answer: A) push()

  20. Which object is the root of all JavaScript objects?
    A) Window
    B) Global
    C) Object
    D) Main
    Answer: C) Object


AngularJS MCQs

    1. AngularJS is based on which architecture?
      A) MVP
      B) MVC
      C) MVVM
      D) OOP
      Answer: B) MVC

    2. Which directive is used to bind data in AngularJS?
      A) ng-bind
      B) ng-model
      C) ng-data
      D) ng-controller
      Answer: A) ng-bind

    3. Which symbol is used for AngularJS expressions?
      A) {{ }}
      B) (( ))
      C) [[ ]]
      D) << >>
      Answer: A) {{ }}

    4. Which directive initializes an AngularJS application?
      A) ng-start
      B) ng-init
      C) ng-app
      D) ng-model
      Answer: C) ng-app

    5. Which directive repeats a set of HTML elements?
      A) ng-repeat
      B) ng-for
      C) ng-loop
      D) ng-each
      Answer: A) ng-repeat

    6. How do you create a controller in AngularJS?
      A) app.control()
      B) app.controller()
      C) app.createController()
      D) app.addController()
      Answer: B) app.controller()

  1. AngularJS expressions are written inside…
    A) {}
    B) {{}}
    C) %%
    D) ##
    Answer: B) {{}}

  2. What does the ng-model directive bind to?
    A) HTML tags
    B) Controller
    C) Form inputs
    D) JavaScript functions
    Answer: C) Form inputs

  3. Which directive is used for conditional rendering?
    A) ng-if
    B) ng-condition
    C) ng-show
    D) ng-hide
    Answer: A) ng-if

  4. Which module is required for forms in AngularJS?
    A) ng-form
    B) ng-model
    C) ngFormsModule
    D) ngFormModule
    Answer: A) ng-form

  5. AngularJS filters are used to…
    A) Bind controllers
    B) Filter HTML tags
    C) Format data
    D) Encrypt data
    Answer: C) Format data

  6. Which filter is used to sort data?
    A) orderBy
    B) filter
    C) sortBy
    D) ngSort
    Answer: A) orderBy

  7. Which directive is used for validation in AngularJS?
    A) ng-validate
    B) ng-required
    C) ng-check
    D) ng-valid
    Answer: B) ng-required

  8. What is the output of {{ 5 + 10 }} in AngularJS?
    A) 15
    B) 5 + 10
    C) Error
    D) undefined
    Answer: A) 15

  9. Which directive is used to display content conditionally?
    A) ng-hide
    B) ng-if
    C) ng-show
    D) All of the above
    Answer: D) All of the above

  10. What is the use of $scope in AngularJS?
    A) Store JavaScript libraries
    B) Bind view and controller
    C) Link CSS
    D) Compile HTML
    Answer: B) Bind view and controller

  11. Which directive is used to include HTML pages?
    A) ng-include
    B) ng-html
    C) ng-append
    D) ng-copy
    Answer: A) ng-include

  12. Which of the following is an AngularJS module?
    A) angular.module()
    B) angular.controller()
    C) angular.bind()
    D) angular.object()
    Answer: A) angular.module()

  13. AngularJS was developed by?
    A) Microsoft
    B) Google
    C) Facebook
    D) IBM
    Answer: B) Google

  14. Which keyword is used for dependency injection in AngularJS?
    A) @inject
    B) $inject
    C) inject()
    D) ng-inject
    Answer: B) $inject

Mixed MCQs (Advanced)

  1. What is the output of typeof null?
    A) null
    B) undefined
    C) object
    D) string
    Answer: C) object

  2. Which method is used to convert a JSON string into a JavaScript object?
    A) JSON.toObject()
    B) JSON.parse()
    C) parse.JSON()
    D) object.JSON()
    Answer: B) JSON.parse()

  3. What does NaN stand for?
    A) Not a Null
    B) Not a Number
    C) Null and None
    D) Not an Name
    Answer: B) Not a Number

  4. Which of the following is a valid AngularJS directive?
    A) ng-value
    B) ng-check
    C) ng-size
    D) ng-css
    Answer: A) ng-value

  5. What is the use of the splice() method?
    A) Add or remove elements
    B) Split strings
    C) Merge arrays
    D) Find elements
    Answer: A) Add or remove elements

  6. Which directive is used to handle click events in AngularJS?
    A) ng-click
    B) ng-tap
    C) ng-event
    D) ng-hit
    Answer: A) ng-click

  7. Which statement is true about JavaScript arrays?
    A) Arrays are fixed in size
    B) Arrays can hold multiple data types
    C) Arrays are only numeric
    D) Arrays cannot be nested
    Answer: B) Arrays can hold multiple data types

  8. How can you redirect a page using JavaScript?
    A) window.location.href = “url”;
    B) document.href = “url”;
    C) location = “url”;
    D) window.redirect(“url”);
    Answer: A) window.location.href = “url”;

  9. Which directive prevents form submission if a field is empty?
    A) ng-model
    B) ng-submit
    C) ng-required
    D) ng-value
    Answer: C) ng-required

  10. Which JavaScript keyword is used to declare a constant variable?
    A) const
    B) var
    C) let
    D) constant
    Answer: A) const

Thanks for Reading the m2-r5 mcq questions with answers

Subscribe Our Youtube Channel

Also Check Our Latest Upload

M2r5 mcq questions in hindi

O level m2 r5 mcq questions and answers

Leave a Comment