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
Show dynamic typing
easy10 minA variable holds a number then a string — report the final type.
- 2
Use a function as a value
easy10 minStore a function in a variable, call it, and show the result.
- 3
Use a template literal
easy10 minBuild the greeting "Hello Ada" with a template literal.
- 4
Use an object
easy10 minRead the title property from an object and show it.
- 5
Use an array method
medium10 minDouble every number in [1,2,3] and join them with dashes.
Find the bug(5)
- 1
Fix the function that is never called
easy8 minThe function itself is shown instead of its result.
- 2
Fix the template literal quotes
easy8 minNormal quotes do not interpolate the variable.
- 3
Fix the wrong property name
easy8 minThe object has no such property, so this shows undefined.
- 4
Fix the map that returns nothing
easy8 minThe arrow body uses braces without a return.
- 5
Fix the typeof check
easy8 minThis 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