Giter Site home page Giter Site logo

week6-homework's Introduction

Related homework These are instruction for further exercise on promises.

Read the steps in order, as you're not supposed to fork this repository but rather create your own.

Step 1: create your own repo Note: You might require to google informations if you don't remember how to do everything! Even better, do this together as a part of a group call.

Create a new folder in your computer called week6_homework. Initialise a new git repository inside the folder. Create a new repository called week6-homework on Github. Keep it empty, don't add Readme or License. Add the new Github repository address as a remote called origin to your local git repository. Create a README.md file and write a small description. Commit and push to Github. Post the link in the class channel. Step 2: In your homework repository, create a new file called 01_promise.js. Write a function that returns a promise. This promise should resolve, returning the string "success". Commit and push. Step 3: In your homework repository, create a new file called 02_promiseSelector.js. Write a function that returns a promise. This promise should resolve, returning the string "success", if the function is passed true as argument. Otherwise, it should reject with the string "failure". Commit and push. Step 4: In your homework repository, create a new file called 03_promiseDelay.js. Write a function that returns a promise. This promise should resolve, returning the string "success", after 1 second. use setTimeout() to implement the delay. Commit and push. Step 5: In your homework repository, create a new file called 04_promisifiedTimeout.js. Write a function that returns a promise. This promise should resolve, returning the string "success", after the amount of milliseconds passed as an argument to the function. use setTimeout() to implement the delay. note: you effectively 'promisified' setTimeout(), transforming a function that use the callback pattern to one that use promises! Commit and push.

week6-homework's People

Contributors

efahmed avatar

Watchers

James Cloos 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.