Spaceport

Overview

In front end web development, the programming language you will encounter most often is JavaScript. Soon, we’ll also use HTML and CSS to help a user interact with our applications, however before we do that, we need to understand how to use JavaScript to handle the logic of our applications.

In this project, you’ll be gaining experience working with variables, primitive data types, looping, arrays, objects and classes. As you work through the iterations, be sure to take time to stop and refactor you solutions. There is rarely one right way to solve a problem in programming, and part of your job will be evaulating the trade offs between different approaches to solving a problem.

Learning goals

  • Understand what JavaScript primatives are, and how/when to use them
  • Understand how to declare variables and assign data to them
  • Practice using objects
  • Practice defining and creating classes

Setup

  • Fork this project to your own Github account
  • clone the repository to your local machine
  • cd into the project
  • run npm install to install the necessary dependencies

Iterations

0: Practice Variables, Primitives, Functions, Arrays, and Objects

  • In the src/ directory, you’ll find a file called ‘warm-up.js’. Read through the instructions in the file carefully. The exercises in this file will help you to complete the rest of the iterations

1: Create Being & Part Classes

  • For the rest of the iterations, you will be working to build out some classes, using a test suite as your guide.
  • Start with the Being class.
    • Unskip the first test in test/being.js
    • Run npm test test/being.js
    • Read the error messages CAREFULLY!
  • Once you’ve fully implemented the Being class, move on to the tests for the Part class
    • Run npm test test/part.js
  • Before moving on to the next iteration, take time to refactor your solutions. Is this the best approach to solving the problem? Is there a different way you could make the tests pass?

2: Create Ship Class

  • Unskip the first test in test/ship.js, and get to work implementing
  • Run npm test test/ship.js
  • Before moving on to the next iteration, take time to refactor your solutions. Is this the best approach to solving the problem? Is there a different way you could make the tests pass?

3: Create Shop Class

  • Unskip the first test in test/shop.js, and get to work implementing
  • Run npm test test/shop.js
  • Before moving on to the next iteration, take time to refactor your solutions. Is this the best approach to solving the problem? Is there a different way you could make the tests pass?

4: Create Planet Class

  • Unskip the first test in test/planet.js, and get to work implementing
  • Run npm test test/planet.js

Lesson Search Results

Showing top 10 results