CMIT 382 FINAL EXAM LATEST 2024/2025 REAL EXAM 2 LATEST
VERSIONS QUESTIONS AND CORRECT ANSWERS| GET 100%
CORRECT SOLUTIONS
Applying the Clickable class to a span enables the span to respond to click events.
A. True
B. False - B. False
Assignment 2 solution
The key attribute is always optional with JSX elements.
A. True
B. False - B. False
https://reactjs.org/docs/lists-and-keys.html#keys
Using bind() with event handlers sets the object instance within the event handler
scope.
A. True
B. False - A. True
Hover over the word bind on code sandbox
Using slice() to modify a copy of a class state property prevents unintentional rendering.
A. True
B. False - A. True
https://www.w3schools.com/jsref/jsref_slice_array.asp
Identify the correct definition of the code super(props).
A. Call a class parent constructor and pass props as an argument
B. Initialize class state with props
C. Prepare a JSX element
D. Initialize a function-based React component - A. Call a class parent constructor and
pass props as an argument
https://stackoverflow.com/questions/30571875/whats-the-difference-between-super-
and-superprops-in-react-when-using-e
,Select the code that binds a form control value to a class state property value.
A. handleAddButtonClick
B. key = {index}
C. value = {this.state.text}
D. .filter() - C. value = {this.state.text}
The code { data } is equivalent to { data: data }.
A. True
B. False - A. True
The array filter() method creates an array filled with all array elements that pass a test
(provided as a function).
A. True
B. False - A. True
Identify the correct JSX comment syntax.
A. /* */
B. {/* */}
C. { }
D. // - B. {/* */}
Identify the correct definition of transpiling.
A. Converting source code to an executable file
B. Execution of source code through an interpreter program
C. Converting source code from one language or version to another language or version
D. Offloading of source from local resources to the cloud - C. Converting source code
from one language or version to another language or version
The fundamental ReactJS paradigm is component state changes lead to visual element
changes.
A. True
B. False - A. True
https://reactjs.org/
JSX does NOT support self-closing tags.
A. True
B. False - B. False
, https://reactjs.org/docs/introducing-jsx.html
Function-based React components MUST implement a constructor() method.
A. True
B. False - B. False
https://reactjs.org/docs/react-component.html#constructor
Identify the correct JSX attribute to associate a CSS class with a JSX div element.
A. id
B. class
C. classname
D. className - D. className
Given the following array definitions, identify the correct syntax to populate the empty
array.
let d = ["A ", "B "];
let n = [];
A. d.map((e, i) => n.push(i + ":" + e));
B. d.map(function (e, i) { n.push(i + ":" + e); });
C. Both A and B would populate the empty array
D. Neither A or B would populate the empty array - C. Both A and B would populate the
empty array
https://www.w3schools.com/jsref/jsref_map.asp
1 function Greeting(props) {
2 const name = this.props.name ? this.props.name : "Guest";
3 return (
4 <h1>Hello name</h1>
5 <h2>How are you?</h2>
6 );
7}
Identify the problem on line #2.
A. const should be replaced with let
B. The ternary operator is : ?
C. Inclusion of this instance object is incorrect
D. "Guest" must be 'Guest' - C. Inclusion of this instance object is incorrect
1 function Greeting(props) {
VERSIONS QUESTIONS AND CORRECT ANSWERS| GET 100%
CORRECT SOLUTIONS
Applying the Clickable class to a span enables the span to respond to click events.
A. True
B. False - B. False
Assignment 2 solution
The key attribute is always optional with JSX elements.
A. True
B. False - B. False
https://reactjs.org/docs/lists-and-keys.html#keys
Using bind() with event handlers sets the object instance within the event handler
scope.
A. True
B. False - A. True
Hover over the word bind on code sandbox
Using slice() to modify a copy of a class state property prevents unintentional rendering.
A. True
B. False - A. True
https://www.w3schools.com/jsref/jsref_slice_array.asp
Identify the correct definition of the code super(props).
A. Call a class parent constructor and pass props as an argument
B. Initialize class state with props
C. Prepare a JSX element
D. Initialize a function-based React component - A. Call a class parent constructor and
pass props as an argument
https://stackoverflow.com/questions/30571875/whats-the-difference-between-super-
and-superprops-in-react-when-using-e
,Select the code that binds a form control value to a class state property value.
A. handleAddButtonClick
B. key = {index}
C. value = {this.state.text}
D. .filter() - C. value = {this.state.text}
The code { data } is equivalent to { data: data }.
A. True
B. False - A. True
The array filter() method creates an array filled with all array elements that pass a test
(provided as a function).
A. True
B. False - A. True
Identify the correct JSX comment syntax.
A. /* */
B. {/* */}
C. { }
D. // - B. {/* */}
Identify the correct definition of transpiling.
A. Converting source code to an executable file
B. Execution of source code through an interpreter program
C. Converting source code from one language or version to another language or version
D. Offloading of source from local resources to the cloud - C. Converting source code
from one language or version to another language or version
The fundamental ReactJS paradigm is component state changes lead to visual element
changes.
A. True
B. False - A. True
https://reactjs.org/
JSX does NOT support self-closing tags.
A. True
B. False - B. False
, https://reactjs.org/docs/introducing-jsx.html
Function-based React components MUST implement a constructor() method.
A. True
B. False - B. False
https://reactjs.org/docs/react-component.html#constructor
Identify the correct JSX attribute to associate a CSS class with a JSX div element.
A. id
B. class
C. classname
D. className - D. className
Given the following array definitions, identify the correct syntax to populate the empty
array.
let d = ["A ", "B "];
let n = [];
A. d.map((e, i) => n.push(i + ":" + e));
B. d.map(function (e, i) { n.push(i + ":" + e); });
C. Both A and B would populate the empty array
D. Neither A or B would populate the empty array - C. Both A and B would populate the
empty array
https://www.w3schools.com/jsref/jsref_map.asp
1 function Greeting(props) {
2 const name = this.props.name ? this.props.name : "Guest";
3 return (
4 <h1>Hello name</h1>
5 <h2>How are you?</h2>
6 );
7}
Identify the problem on line #2.
A. const should be replaced with let
B. The ternary operator is : ?
C. Inclusion of this instance object is incorrect
D. "Guest" must be 'Guest' - C. Inclusion of this instance object is incorrect
1 function Greeting(props) {