Module quiz: navigation, updating and assets in React.js
11. True or false? In React, you can use a ternary operator in a component's return statement in React.
- True
- False
12. React Router is...
- A stand-alone package that you can add to a React app.
- A built-in part of React.
- A built-in part of React-DOM.
14. Please choose the valid command to install react-player.
- npm install react-player
- npm-install react-player
- npm-install-react-player
16. What will be the output of the code below?
let name; if (Math.random() > 0.5) { name = "Mike"} else { name = "Susan"}
- It will always be Susan
- It will be 0.5
- It will be sometimes Mike, and sometimes Susan, randomly
- It will always be Mike
17. Is the following component syntactically correct?
import car from "./assets/images/car.jpg";
function CarImage() {
return (
< img
height={200}
src={car}
alt="Car image"
/ >
);
};
export default CarImage;
- Yes
- No
19. What is the syntax used to add a new dev dependency to a React app? Select all that apply.
- node init some-package-name
- npm init some-package-name
- npm install –save-dev some-package-name
- npm i –save-dev some-package-name