Code Monkey home page Code Monkey logo

haverjsassessment's Introduction

Harver JS Assessment

Get started

Set this repository up by running:

cd /path/to/harver-js-test
npm install

Edit your code in src/index.js and run npm start to run the code.

The tasks in this assessment use the included package word-maker which can be found in the directory ./word-maker. This directory also contains a README.md with details about its usage and API. The module is already required for you in src/index.js

Tasks

Complete these tasks in order. If you can't complete a task, just proceed with the next one.

  1. Print numbers from 1 to 100 to the console, but for each number also print a random word using the function getRandomWordSync. E.g.
1: four
2: firm
3: shape
4: choice
5: coach
6: purple
...
100: buffalo
  1. Modify your code to be a "Fizz Buzz" program. That is, print the numbers as in the previous step, but for multiples of three, print "Fizz" (instead of the random word), for multiples of five, print "Buzz" and for numbers which are both multiples of three and five, print "FizzBuzz".

  2. Create a version of steps 1 and 2 using the asynchronous function, getRandomWord. This function returns a Promise, which resolves to a random word string. The numbers may or may not be in numerical order.

  3. Add error handling to both the synchronous and asynchronous solutions (calling getRandomWord({ withErrors: true }) will intermitently throw an error instead of return a random word). When an error is caught, the programm should print "Doh!" instead of the random word, "Fizz", "Buzz" or "FizzBuzz"

  4. For Node.JS developers: Instead of printing the console. Write the information to a file in the root of this project. For Frontend developers, send your result to an HTTP endpoint (since there is no running endpoint, this part of your solution does not need to actually run)

haverjsassessment's People

Contributors

abdulnizam 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.