Code Monkey home page Code Monkey logo

javascript-challenges's Introduction

JavaScript Challenges

A collection of JavaScript coding challenges.

Getting Started

The only dependencies in this repo are for running the tests, which are written in Tape and Sinon.

Install the dependencies

npm i

Then, in each challenge folder, you can run the following to see the tests for that challenge.

node <challenge>-test.js

Solving Challenges

This repo is only a set of challenges, it does not include the answers to any of the challenges.

If you implement a solution of your own, please do not post it publicly on this repository. Opening an issue or a pull request with a solution spoils the experience of the challenge for other developers who find this repository.

Challenges

Beginner

Intermediate

Advanced

Relevant Reading

javascript-challenges's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

javascript-challenges's Issues

How to Run Tests? Error: Cannot find module 'tape'

While following this instruction I ran into a wall:

Run node most-recurrent-test.js to run the test suite in full.

An error was thrown in terminal that read as follows

$ node most-recurrent-test.js
module.js:442
throw err;
^

Error: Cannot find module 'tape'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/Users/Ian/Desktop/codeTests/javascript-challenges/number-frequency/most-recurrent-test.js:1:76)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)

I became lost while trying to debug this. Thoughts?

Unclear requirement for add-eventing

I didn't understand this requirement; "if obj.trigger is called with additional arguments it should pass those to the listeners". Could you please provide an example of what is expected?

Write me a function that will remove all undefined and null values from a JS object

Given this JS object

const george = {
  name: 'George Costanza',
  age: 37,
  skills: undefined,
  vocation: null
}

Write me a function that will return a new object (no mutation) with any null or undefined values excluded.

const newGeorge = removeNil(obj)
console.log(newGeorge) // { name: 'George Costanza', age: 37 }

Add in the ability for me to include source objects, similar to the ES6 Object.assign method.

const art = removeNil(obj, { name: 'Art Vandelay', age: null, vocation: 'architect' })
console.log(art) // { name: 'Art Vandelay', vocation: 'architect' }

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.