exercises-js-fundamentals
exercises-js-fundamentals copied to clipboard
A collection of JavaScript exercises for new learners
JavaScript Exercises - Fundamentals
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.
Feedback
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
JavaScript Crash Course Sections
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
Numbers
- isZero
- isPositive
- isNegative
- isEven
- isOdd
- remainderOf
- isMultipleOf
- power
- isPowerOf
- isPowerOfTwo
- isPerfectSquare
- factors
- isPrime
- primeFactors
- sumOfRange
- factorial
- celsiusToFahrenheit
- fahrenheitToCelsius
- fibonacci
Strings
- countLetter
- capitalize
- longestWord
- shortestWord
- replaceCharacter
- replaceCharacters
- toLowercase
- toUppercase
- toSnakeCase
- toTitleCase
- rot13
- rotN
Branching / Conditionals
- daysInMonthByNumber
- letterGrade
- isValidTriangle
- triangleType
- rockPaperScissorsWinner
Patterns to Print
- printSolidSquare
- printSolidRightTriangle
- printSolidPyramid
- printHollowSquare
- printHollowRightTriangle
- printHollowPyramid
- printInvertedSolidRightTriangle
- printMultiplicationTable
- printPlus
Arrays
- 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