Skip to main content

JavaScript Features — exercises and bug fixes

5 hands-on exercises and 5 find-the-bug challenges for the JavaScript Features lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.

Exercises(5)

  1. 1

    Show dynamic typing

    easy10 min

    A variable holds a number then a string — report the final type.

  2. 2

    Use a function as a value

    easy10 min

    Store a function in a variable, call it, and show the result.

  3. 3

    Use a template literal

    easy10 min

    Build the greeting "Hello Ada" with a template literal.

  4. 4

    Use an object

    easy10 min

    Read the title property from an object and show it.

  5. 5

    Use an array method

    medium10 min

    Double every number in [1,2,3] and join them with dashes.

Find the bug(5)

  1. 1

    Fix the function that is never called

    easy8 min

    The function itself is shown instead of its result.

  2. 2

    Fix the template literal quotes

    easy8 min

    Normal quotes do not interpolate the variable.

  3. 3

    Fix the wrong property name

    easy8 min

    The object has no such property, so this shows undefined.

  4. 4

    Fix the map that returns nothing

    easy8 min

    The arrow body uses braces without a return.

  5. 5

    Fix the typeof check

    easy8 min

    This reports the type of the old value.

Ready to write the code?

The editor, the automatic checks and the worked solutions open up with an account.

Open the workspace