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. The ___________ is an officially supported way to create React applications.
A. create
B. create-react-app
C. react-app
D. create react app
View Answer
Ans : B
Explanation: The create-react-app is an officially supported way to create React applications.
3. 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
4. Which company is Developer of react?
A. Microsoft
B. Google
C. Facebook
D. IBM
View Answer
Ans : C
Explanation: React.JS was first used in 2011 for Facebook's Newsfeed feature.Facebook Software Engineer, Jordan Walke, created it.
5. 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.
6. ES6 stands for ?
A. ECMAScript 6
B. ECMA 6
C. ECMAJavaScript 6
D. EJavaScript 6
View Answer
Ans : A
Explanation: ES6 stands for ECMAScript 6.ECMAScript was created to standardize JavaScript, and ES6 is the 6th version of ECMAScript, it was published in 2015, and is also known as ECMAScript 2015.
7. 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.
8. The properties are assigned inside a __________ method
A. get()
B. constructor()
C. destructor()
D. init()
View Answer
Ans : B
Explanation: The properties are assigned inside a constructor() method.
9. 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.
10. Which method refers to the parent class?
A. inherits
B. self
C. super
D. this
View Answer
Ans : C
Explanation: The super() method refers to the parent class. By calling the super() method in the constructor method, we call the parent's constructor method and gets access to the parent's properties and methods.
11. 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.
12. React renders HTML to the web page by using a function called?
A. ReactDOM.render()
B. render()
C. ReactDOM_render()
D. React.render()
View Answer
Ans : A
Explanation: React renders HTML to the web page by using a function called ReactDOM.render().
13. 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.
14. With JSX you can write expressions inside?
A. ()
B. []
C. " "
D. {}
View Answer
Ans : D
Explanation: With JSX you can write expressions inside curly braces { }.
15. 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.
16. The constructor function is called automatically when the object is initialized.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, The constructor function is called automatically when the object is initialized.
17. Everything in react is a?
A. Module
B. Package
C. Class
D. Component
View Answer
Ans : D
Explanation: Everything in react is a Component.
18. What is ReactJS?
A. Server side Framework
B. User-interface framework
C. Database
D. A Library for building interaction interfaces
View Answer
Ans : D
Explanation: ReactJS is a Library for building interaction interfaces
19. 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.
20. The component also requires a render() method, this method returns?
A. PHP
B. javascript
C. HTML
D. SQL
View Answer
Ans : C
Explanation: The component also requires a render() method, this method returns HTML.
Discussion