GithubHelp home page GithubHelp logo

jino1211 / promises-exercises Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lighthouse-labs/promises-exercises

0.0 0.0 0.0 56 KB

Set of exercises in using JS promises for handling asynchronous operations.

License: MIT License

JavaScript 100.00%

promises-exercises's Introduction

promises-exercises

Set of exercises in using JS promises for handling asynchronous operations.

Setup

  1. Fork this repository.
  2. Run npm install to download the Node modules.

Using

For these exercises, there are a few folders, each corresponding to a step in the lesson. Each of them has a README.md, a test.js, and an answers.js. Read the README.md for further instructions, implement the methods in the answers.js, passing the tests in the tests.js file. The answers has a

Quick tip: To run any of the exercises below in watch mode, add -- --watch, (e.g. npm run 01-making-promises -- --watch)

You are free to look at any of the tests for guidance, but don't change them.

Outline

The Promise Toolbox

These exercises are all about learning the mechanisms that we can use to create, transform, and combine promises.

  • npm run 01-making-promises - Create promises with Promise.resolve, Promise.reject, and the Promise constructor.
  • npm run 02-consuming-promises - Use .then(cb) and .catch(cb) to respond to a promise completing and do something with the result.
  • npm run 03-transforming-promises - Use .then(cb) and .catch(cb) to transform the results of async processes.
  • npm run 04-chaining-promises - Use .then(cb) and .catch(cb) to chain async processes.

Promise Puzzles

Now it's time to use the tricks from above to solve some problems.

  • npm run 05-callbacks - Turn callback-centric functions into promise-centric functions.

promises-exercises's People

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.