Redux Js MCQ Questions
11. Predictability of Redux is determined by __________ most important principles.
A. Two
B. Three
C. Four
D. Five
View Answer
Ans : B
Explanation: Predictability of Redux is determined by three most important principles : Single Source of Truth, State is Read-only and Changes are made with pure functions.
12. ___________ is a plain object that describes the intention to cause change with a type property.
A. class
B. plain
C. action
D. object
View Answer
Ans : C
Explanation: An action is a plain object that describes the intention to cause change with a type property.
13. Redux follows the ____________ data flow.
A. unidirectional
B. bidirectional
C. Both A and B
D. None of the above
View Answer
Ans : A
Explanation: Redux follows the unidirectional data flow.
14. The _______ notifies the view by executing their callback functions
A. state
B. store
C. reducer
D. action
View Answer
Ans : B
Explanation: The store notifies the view by executing their callback functions
15. Redux can have _________ store in your application
A. single
B. double
C. multi
D. None of the above
View Answer
Ans : A
Explanation: Redux can have only a single store in your application. Whenever a store is created in Redux, you need to specify the reducer.
16. Which method helps you retrieve the current state of your Redux store?
A. dispatch
B. subscribe
C. action
D. getState
View Answer
Ans : D
Explanation: getState : It helps you retrieve the current state of your Redux store.The syntax for getState is as follows : store.getState()
17. Which of the following rules are correct for Pure Functions?
A. A function returns the same result for same arguments.
B. Its evaluation has no side effects, i.e., it does not alter input data.
C. No mutation of local & global variables
D. All of the above
View Answer
Ans : D
Explanation: All of the above are rules for Pure function.
18. Pure functions are unpredictable
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : B
Explanation: False, Pure functions are predictable.
19. Both props and state are plain JavaScript objects.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, Both props and state are plain JavaScript objects.
20. Which method allows you to dispatch an action to change a state in your application?
A. getState
B. setState
C. dispatch
D. subscribe
View Answer
Ans : C
Explanation: dispatch : It allows you to dispatch an action to change a state in your application.The syntax for dispatch is as follows : store.dispatch({type:'ITEMS_REQUEST'})
Discussion