Training Guide: Programming in HTML5 with JavaScript and CSS3 Ebook

(Nora) #1

Answers CHAPTER 8 391


Answers


This section contains the answers to the lesson review questions in this chapter.

Lesson 1



  1. Correct answer: D
    A. Incorrect: You can’t publish a JavaScript file by itself because you need to include a
    manifest, which is the package.json file.
    B. Incorrect: A module is a file, and you can’t publish a module by itself because you
    need to include a manifest, which is the package.json file.
    C. Incorrect: A file or module can contain classes, but the manifest, which is the pack-
    age.json file, is required.
    D. Correct: The package contains a package.json manifest and the modules you want
    to publish.

  2. Correct answers: A and D
    A. Correct: A package can be installed locally.
    B. Incorrect: Grouped is not a valid scope.
    C. Incorrect: Named is not a valid scope.
    D. Correct: A package can be installed globally.

  3. Correct answer: D
    A. Incorrect: The express package, also known as expressjs, simplifies website creation
    but does more.
    B. Incorrect: The express package provides session management but does more.
    C. Incorrect: The express package simplifies retrieval of static content but does more.
    D. Correct: The express package simplifies website creation, provides session man-
    agement, and simplifies retrieval of static content.


Lesson 2



  1. Correct answer: C
    A. Incorrect: CREATE is not an HTTP method.
    B. Incorrect: RETRIEVE and UPDATE are not HTTP methods.
    C. Correct: PUT is for create, GET is for retrieve, POST is for update, and DELETE is for
    delete.
    D. Incorrect: UPDATE is not an HTTP method.

Free download pdf