Repository of challenges for practicing JavaScript. You should have a basic understanding of JavaScript data types (string
, boolean
, number
, array
, object
), control flow (if
, else
), creating functions, looping (for
, while
) and basic jQuery. You should also know how to create HTML pages and add CSS and JaaScript to the page.
The challenges are numbered. You should do them roughly in order as each one builds off the previous.
For each challenge, think through the problem in three steps:
- Pseudocode - What are the things we need or need to know about?. Write it out in plain English, don't worry about syntax.
- Implementation - How do we start turning our pseudocode into actual code? Go line by line and turn the concepts you wrote out into working JavaScript code. Sometimes you'll realize you left out some steps in the pseudocode. That's ok, add it in!
- Refactor - What can we clean up or abstract?. Once it's working, see if there's any code that you can make simpler or more clear to another developer, or more concise with less code. Can you make it more efficient? Are there parts we can abstract for reuse later?
Found a typo? Want to add a challenge? Fork me and send me a pull request!
Some of these were adapted from here: http://www.teaching-materials.org/javascript/. Others came to me in my sleep and may have been influenced by outside forces.