Module quiz: navigation, updating and assets in React.js

Module quiz: navigation, updating and assets in React.js

  1. True or false? In React, you can use a ternary operator in a component's return statement in React.

    • True

    • False

  2. React Router is...

    • A built-in part of React-DOM.

    • A stand-alone package that you can add to a React app.

    • A built-in part of React.

  3. React Router has a <Link> element.

    • True

    • False

  4. Please choose the valid command to install react-player.

    • npm install react-player

    • npm-install react-player

    • npm-install-react-player

  5. True or false? webpack is a module bundler.

    • True

    • False

  6. What will be the output of the code below?

     let name; if (Math.random() > 0.5) { name = "Mike"} else { name = "Susan"}
    
    • It will be 0.5

    • It will always be Susan

    • It will always be Mike

    • It will be sometimes Mike, and sometimes Susan, randomly

  7. 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

  8. What is an asset?

    • Images, stylesheets, fonts

    • Components

    • Images, video, and components

  9. 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 install –save-dev some-package-name

    • npm i –save-dev some-package-name

    • npm init some-package-name

  10. If your app can compile without it, you can keep an asset in a public folder.

    • True

    • False