This is a big collection of JavaScript exercises. Within each section, the exercises are roughly ordered from least to most difficult.
We recommend doing the first 3-5 exercises in each section before doing deeper in any single section.
If a particular concept isn't familiar to you, go read the relevant section in the JavaScript crash course.
Remember, the goal is not to nail every exercise, but to create good opportunities for feedback. That means:
- Devise a clear (but probably incomplete or mistaken) plan
- Implement that plan in code as best you can
- Get feedback from the computer, peers, and instructors
- Revise plan and repeat
Here are some quick links to the different sections in the JavaScript crash course.
- JavaScript crash course homepage
- Numbers and Strings
- Variables
- Conditionals
- Arrays and Dictionaries
- Looping
- Functions
- isZero
- isPositive
- isNegative
- isEven
- isOdd
- remainderOf
- isMultipleOf
- power
- isPowerOf
- isPowerOfTwo
- isPerfectSquare
- factors
- isPrime
- primeFactors
- sumOfRange
- factorial
- celsiusToFahrenheit
- fahrenheitToCelsius
- fibonacci
- countLetter
- capitalize
- longestWord
- shortestWord
- replaceCharacter
- replaceCharacters
- toLowercase
- toUppercase
- toSnakeCase
- toTitleCase
- rot13
- rotN
- printSolidSquare
- printSolidRightTriangle
- printSolidPyramid
- printHollowSquare
- printHollowRightTriangle
- printHollowPyramid
- printInvertedSolidRightTriangle
- printMultiplicationTable
- printPlus
- largest
- smallest
- longest
- shortest
- sum
- mean
- median
- product
- includes
- firstIndexOf
- lastIndexOf
- countEvens
- countOdds
- countGreaterThan
- countLessThan
- countValue
- selectEvens
- selectOdds
- selectGreaterThan
- selectLessThan
- selectLongerThan
- selectShorterThan
- allPositive
- anyPositive
- concat
- removeEmpty
- removeElement
- selectAboveMean