In this exercise, you'll need to solve a set of increasingly difficult puzzles aimed at helping you master the fundamentals of JavaScript. The exercise is split into two parts.
Part 1 has you wrestling with core JavaScript concepts.
- Primitives
- Functions
- Declarations
- Globals
- Operators
- Control flow
Part 2 builds on the above and has you wrestling with more essential concepts.
- Functions (again)
- Arrays
- Objects
- Iterations
Furthermore, each part has two components—an assignment and a bonus. Complete the each part's assignment before moving on to its respective bonus or the next part's assignment.
TIP: You're encouraged to use online documentation to lookup how to use unfamiliar concepts.
To get started, download this code onto your machine by following these setup instructions.
- Fork this repository to your own GitHub account.
- Clone your forked repository to your development environment.
- Open the repository's project directory in your text editor.
- Open the
part1/assignment.html
file in your web browser.
In your web browser, you'll see a page that shows a bunch of failing JavaScript tests. Locate the area that shows how many tests are passing and how many are failing.
Your job is to make all these JavaScript tests pass by completing their respective puzzle.
- Open the
part1/assignment.js
file in your text editor. - Read the instructions for each puzzle.
- Solve the puzzle by writing JavaScript.
Once it's ready, test your solution.
- Tab over to the browser with
Command + Tab
. - Refresh the browser with
Command + R
. - Scroll to the puzzle's test and see if it's still red.
- Once the test is green, you've solved the puzzle.
You can see how each test invokes the puzzle's function by clicking on the test description.
You may encounter challenges that seem confusing or impossible. Don't despair! This exercise is designed to challenge you. Resist the urge to just copy-and-paste code from your classmates, but definitely ask for help and talk to your peers.
When you're done with the main assignment, your page should look like this. Green check marks next to each test means the entire test suite is passing.
Looking for more challenge? Well, there's a whole set of bonus puzzles just waiting to be solved!
- Open the
part1/bonus.html
file in your web browser. - Open the
part1/bonus.js
file in your text editor. - You know the drill :)
Don't forget about part 2 located in the part2/
directory. These puzzles will most likely make more sense once your instructor has gone over the next JavaScript concepts in class.
Read over the following articles to learn how to deploy this web site to Surge.
A good domain name for this project is USERNAME-js-fundamentals.surge.sh
where USERNAME
is your GitHub username in all lowercase letters. Once deployed and everything works as you expect, copy the URL to your site and paste it below.
PASTE YOUR SURGE URL HERE
After everything works as you expect, it's time to submit your work.
- Re-deploy your project to Surge.
- Push your code to GitHub, the
origin
remote. - Copy the URL to your GitHub repository.
- Paste that URL in the textfield for the corresponding exercise.