Each set of exercises is paired
with a chapter of the book.

JavaScript Simplified

Interactive Exercises

Click to select a chapter to practice.

  1. Alerts
  2. Variables
  3. Variables for Numbers
  4. Variable Names Legal and Illegal
  5. Math expressions and operators
  6. ++ and --
  7. Math expressions: Eliminating ambiguity
  8. Concatenating text strings
  9. The template literal
  10. Prompts
  11. Commenting
  12. if statements
  13. Comparison operators
  14. if...else and else...if statements
  15. A shortcut for if...else
  16. Testing for a set of conditions
  17. Where to put your JavaScript code
  18. There are no exercises for this chapter
  19. There are no exercises for this chapter
  20. The const keyword
  21. Arrays
  22. Arrays: pop(), push(), shift(), and unshift()
  23. Arrays: splice()
  24. Arrays: slice()
  25. Arrays: includes(), Array.from(), Array.of()
  26. for loops
  27. More about for loops
  28. Flags and Booleans
  29. for loops: break, continue, and length
  30. Nested loops
  31. for...of
  32. Strings: changing case
  33. Strings: Targeting a character and extracting parts
  34. Measuring a string
  35. Strings: finding segments
  36. Strings: finding a character at a location
  37. Replacing strings
  38. Rounding numbers
  39. Generating pseudo-random numbers
  40. Converting strings to integers and strings to decimal numbers
  41. Controlling the length of decimal numbers
  42. Some more Math methods
  43. Creating a Date object
  44. Extracting parts of the Date object
  45. Setting elements of a Date object
  46. Working with a Date object
  47. Functions
  48. Functions: passing them data
  49. Functions: sending data back from them
  50. A function call can replace a variable
  51. Functions: returning multiple values
  52. Anonymous functions
  53. Arrow functions
  54. Sorting an array
  55. Looping through an array with .forEach()
  56. Local scope vs. global scope
  57. There are no exercises for this chapter
  58. There are no exercises for this chapter
  59. The versatility of functions
  60. Closures
  61. switch statements: how to start them
  62. switch statements: how to complete them
  63. while loops
  64. do...while loops
  65. Event listeners
  66. Targeting an element
  67. Callbacks
  68. Getting and setting a value in a field
  69. textContent
  70. innerHTML
  71. classList
  72. More on classList, plus className
  73. Adding or changing attribute values
  74. Targeting multiple elements
  75. Getting attribute values, removing attributes
  76. Objects and properties
  77. Objects and properties: the dot that connects them
  78. Objects: alternative coding options
  79. Objects: methods
  80. The bind() method
  81. The object constructor function
  82. Objects: adding methods to constructor functions
  83. Objects: prototypes
  84. Objects: checking for properties and methods
  85. There are no exercises for this chapter
  86. The HTTP request
  87. The spread operator
  88. Destructuring arrays and objects
  89. ES6 classes
  90. Creating a new class by inheritance
  91. Adding to the child class
  92. The first six data types
  93. The seventh data type, Symbol
  94. There are no exercises for this chapter
  95. Modules
  96. More ways to do modules
  97. Sets
  98. Sets: Constructing, measuring, deleting, and checking
  99. Sets: converting a set to an array
  100. Loops for sets
  101. Maps
  102. Maps: rules for their keys and methods
  103. The map() method
  104. Planning for failure
  105. Promises - a silly example
  106. The rest of the promise
  107. A practical promise
  108. The DOM
  109. The DOM: the rule of thumb
  110. There are no exercises for this chapter
  111. The DOM: children
  112. The DOM: nodeName, parentNode, and chaining
  113. The DOM: siblings and element siblings
  114. The DOM: firstChild, lastChild, firstChildren, lastChildren
  115. The DOM: comments and attributes
  116. The DOM: getElementsByTagName() and getElementsByClassName()
  117. The DOM: creating nodes
  118. The DOM: Inserting, replacing, and removing nodes