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.
- Which company developed JavaScript?
A) Mozilla
B) Netscape
C) Google
D) IBM
Answer: B) Netscape -
Which symbol is used for comments in JavaScript?
A) //
B) #
C) <!– –>
D) **
Answer: A) // -
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">
-
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”); -
Which of the following is not a JavaScript data type?
A) Undefined
B) Number
C) Float
D) Boolean
Answer: C) Float -
Which function is used to parse a string to int in JavaScript?
A) Integer.parse()
B) parseInt()
C) getInt()
D) parseInteger()
Answer: B) parseInt() -
Which keyword is used to define a function in JavaScript?
A) define
B) function
C) method
D) void
Answer: B) function -
JavaScript is a ___ language.
A) Compiled
B) Interpreted
C) Assembly
D) Machine
Answer: B) Interpreted -
Which method removes the last element from an array?
A) pop()
B) remove()
C) shift()
D) delete()
Answer: A) pop() -
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]; -
Which built-in method returns the length of the string?
A) size()
B) length()
C) index()
D) len()
Answer: B) length -
What is the output of
typeof NaN
?
A) number
B) string
C) undefined
D) object
Answer: A) number -
Which operator is used for strict equality in JavaScript?
A) =
B) ==
C) ===
D) !==
Answer: C) === -
What is the default value of a JavaScript variable?
A) null
B) 0
C) undefined
D) empty
Answer: C) undefined -
What does
isNaN("text")
return?
A) true
B) false
C) 0
D) error
Answer: A) true -
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 -
Which function is used to print in the console?
A) print()
B) write()
C) console.log()
D) echo()
Answer: C) console.log() -
Which symbol is used for single-line comments in JavaScript?
A) /*
B) #
C) //
D) <!–
Answer: C) // -
Which method adds new items to the end of an array?
A) push()
B) append()
C) insert()
D) join()
Answer: A) push() -
Which object is the root of all JavaScript objects?
A) Window
B) Global
C) Object
D) Main
Answer: C) Object
✅ AngularJS MCQs
-
-
AngularJS is based on which architecture?
A) MVP
B) MVC
C) MVVM
D) OOP
Answer: B) MVC -
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 -
Which symbol is used for AngularJS expressions?
A) {{ }}
B) (( ))
C) [[ ]]
D) << >>
Answer: A) {{ }} -
Which directive initializes an AngularJS application?
A) ng-start
B) ng-init
C) ng-app
D) ng-model
Answer: C) ng-app -
Which directive repeats a set of HTML elements?
A) ng-repeat
B) ng-for
C) ng-loop
D) ng-each
Answer: A) ng-repeat -
How do you create a controller in AngularJS?
A) app.control()
B) app.controller()
C) app.createController()
D) app.addController()
Answer: B) app.controller()
-
-
AngularJS expressions are written inside…
A) {}
B) {{}}
C) %%
D) ##
Answer: B) {{}} -
What does the ng-model directive bind to?
A) HTML tags
B) Controller
C) Form inputs
D) JavaScript functions
Answer: C) Form inputs -
Which directive is used for conditional rendering?
A) ng-if
B) ng-condition
C) ng-show
D) ng-hide
Answer: A) ng-if -
Which module is required for forms in AngularJS?
A) ng-form
B) ng-model
C) ngFormsModule
D) ngFormModule
Answer: A) ng-form -
AngularJS filters are used to…
A) Bind controllers
B) Filter HTML tags
C) Format data
D) Encrypt data
Answer: C) Format data -
Which filter is used to sort data?
A) orderBy
B) filter
C) sortBy
D) ngSort
Answer: A) orderBy -
Which directive is used for validation in AngularJS?
A) ng-validate
B) ng-required
C) ng-check
D) ng-valid
Answer: B) ng-required -
What is the output of
{{ 5 + 10 }}
in AngularJS?
A) 15
B) 5 + 10
C) Error
D) undefined
Answer: A) 15 -
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 -
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 -
Which directive is used to include HTML pages?
A) ng-include
B) ng-html
C) ng-append
D) ng-copy
Answer: A) ng-include -
Which of the following is an AngularJS module?
A) angular.module()
B) angular.controller()
C) angular.bind()
D) angular.object()
Answer: A) angular.module() -
AngularJS was developed by?
A) Microsoft
B) Google
C) Facebook
D) IBM
Answer: B) Google -
Which keyword is used for dependency injection in AngularJS?
A) @inject
B) $inject
C) inject()
D) ng-inject
Answer: B) $inject
✅ Mixed MCQs (Advanced)
-
What is the output of
typeof null
?
A) null
B) undefined
C) object
D) string
Answer: C) object -
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() -
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 -
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 -
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 -
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 -
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 -
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”; -
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 -
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
Also Check Our Latest Upload