Skip to content
LearnStack
Node.js curriculum

Node.js practice

Short exercises. Try them first, open the hint if you are stuck, and the solution last.

  1. Exercise 1

    Parse a config

    A Node app often reads JSON config. Parse the string and print the port plus 1.

    Your solutionJavaScript
  2. Exercise 2

    Build a response

    Write respond(status, data) returning an object with status and a JSON string body.

    Your solutionJavaScript
  3. Exercise 3

    Route lookup

    Given a routes object, write handle(url) returning the matching text, or Not found.

    Your solutionJavaScript