React Js MCQ Questions And Answers
ReactJs MCQ : This section focuses on "Basics" of React Js. These Multiple Choice Questions (MCQ) should be practiced to improve the React Js skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. Which of the following is true about React?
A. React is a JavaScript library for building user interfaces.
B. React is used to build single page applications.
C. React allows us to create reusable UI components.
D. All of the above
View Answer
Ans : D
Explanation: All of the above statement are true.
2. Which command is used Install create-react-app?
A. npm install -g create-react-app
B. npm install create-react-app
C. npm install -f create-react-app
D. install -g create-react-app
View Answer
Ans : A
Explanation: Install create-react-app by running this command in your terminal : npm install -g create-react-app
3. Initial Release to the Public (V0.3.0) was in ?
A. 2011
B. 2012
C. 2013
D. 2014
View Answer
Ans : C
Explanation: Initial Release to the Public (V0.3.0) was in July 2013.
4. A class is a type of function, but instead of using the keyword function to initiate it, we use the keyword?
A. constructor
B. class
C. object
D. dataObject
View Answer
Ans : B
Explanation: A class is a type of function, but instead of using the keyword function to initiate it, we use the keyword class.
5. To create a class inheritance, use the ________ keyword.
A. create
B. inherits
C. extends
D. this
View Answer
Ans : C
Explanation: To create a class inheritance, use the extends keyword.
6. In ES6, how many ways of defining your variables?
A. 3
B. 4
C. 5
D. 6
View Answer
Ans : A
Explanation: ES6, there are three ways of defining your variables: var, let, and const.
7. JSX allows us to write HTML elements in JavaScript and place them in the DOM without any?
A. createElement
B. appendChild
C. getElementById
D. Both A and B
View Answer
Ans : D
Explanation: JSX allows us to write HTML elements in JavaScript and place them in the DOM without any createElement() and/or appendChild() methods.
8. Does React creates a VIRTUAL DOM in memory.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, React creates a VIRTUAL DOM in memory.
9. Everything in react is a?
A. Module
B. Package
C. Class
D. Component
View Answer
Ans : D
Explanation: Everything in react is a Component.
10. In React, component properties should be kept in an object called?
A. component
B. super
C. state
D. props
View Answer
Ans : C
Explanation: In React, component properties should be kept in an object called state.
Discussion