Giter Club home page Giter Club logo

js-fundamentals's Introduction

JS Fundamentals

Setup

  1. Fork this repository to your GitHub account
  2. Clone your forked repository to your machine
  3. Change directory into the project.
  4. Install the project dependencies
$ npm install

Exercises

Instructions

Once you've gone through set up, start with the first exercise in the list above. Your job is to write code for each exercise to make the tests pass, one test at a time.

To start, always first run the tests for the set of exercises you are on. The simplest way to do this is to open up the project in VS Code, start a new terminal (Terminal -> New from the menu) then run the npx jasmine command. For example, for the first tests, variables/assignment.spec.js you would run:

$ npx jasmine spec/variables/assignment.spec.js

Inspect this output. Your output might be slightly different. Read through this, and focus on one test at a time. Get the tests to pass by editing the corresponding source file for the test, located in the src directory. In the above example, you would edit src/variables/assignment.js and follow the instructions to make the test pass. Do not change any code in the spec directory.

You might also want to use the --fail-fast option when running the test:

$ npx jasmine --fail-fast=true spec/data-types/arrays/accessing-elements.spec.js

This will stop running the test as soon as the first test case fails. This can make it easier to focus on a single test at a time.

If you are using VS Code, you may also want to consider adding an additional VS Code keyboard shortcut to make it easier to switch between the terminal window and the editor. See this StackOverflow Post.

Getting Help

When you encounter something you don't know, research it, using the MDN Web Docs. The README file for each topic also contains an overview of the concepts required to make the tests pass as well as more specific reference material for each topic. In the README files, when you see this message:

๐Ÿ‘จโ€๐Ÿ’ป Run these examples in your REPL as you read along! ๐Ÿ‘จโ€๐Ÿ’ป

Open up your REPL and type in the code samples as you go.

Updating Progress

Once you've passed the tests for each exercise, push your work to your repository

$ git add src/variables/assignment.js
$ git commit -m "variable assignments completed"

Important - running git commit runs a test to check the formatting of your code. If there are errors the command will abort. Make sure you see no errors in the exercise you completed before continuing. If you see errors, read them carefully and fix your work before repeating the above steps. You can verify a successful commit by checking with git log - verify you see the commit message.

$ git push origin main

Then, move on to the next exercise!

Tests

You can run all the tests manually whenever you want:

$ npm test

This will run two sets of tests.

Linter Tests

Using npm test will first run a set of tests that make sure your code satisfies specific stylistic rules - make sure you resolve these problems as you go.

You can also run the linter manually whenever you want and autocorrect where it's possible:

npx eslint src --fix

Functional Tests

The second set of tests that will run are functional. They test the behaviour of the programs you write.

You can also run the tests manually whenever you want

npx jasmine # run all the tests
# or
npx jasmine spec/variables/assignment.spec.js # run a set of tests in a spec file

js-fundamentals's People

Contributors

mikemherron avatar dearshrewdwit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.