Code Monkey home page Code Monkey logo

js-challenges's Introduction





logo

Some javascript challenges from beginner to advanced difficulty.




Index

What?

A collection of Javascript coding challenges, from beginner to advanced. All challenges are taken from the generous web or created by some awesome contributors.

So, Why?

I'm creating this repo because I want to compile as many coding challenges (for free obviously) in one file. I know that there are many websites like codewars or coderbyte but this is different. These websites may not be free and you may need to pay a subscription.

Challenges

Below are a few challenges - you can get the full documentation here.

If you have an idea on how to improve this repo don't be shy, post a PR or open a new ISSUE!

  1. ROUND NUMBER

    • NAME: round
    • DESCRIPTION: Write a function that rounds a number to given amount of decimal places.
    	round(Math.PI, 2); // => 3.14 
  2. MERGE MULTIPLE ARRAYS

    • NAME: arrayMerge
    • DESCRIPTION: Write a function that merges multiple given arrays.
    	arrayMerge([1, 2], [3, 4]); // => [1, 2, 3, 4]
  3. SUM CONTENT OF AN ARRAY

    • NAME: arraySum
    • DESCRIPTION: Write a function to sum the content of an array.
    	arraySum([1, 2, 3]) // => 6
  4. OBJECT FOREACH

    • NAME: objectForEach
    • DESCRIPTION: Write a forEach function that works with Objects.
    	var obj = {
    		first_name: 'Elon',
    		last_name: 'Musk'
    	}
    
    	objectForEach(obj, (key, value) => {
    		console.log(key, value) 
    	})
    
    	//=> 'first_name', 'Elon'
    	//=> 'last_name', 'Musk'
  5. STRING REVERSE

    • NAME: reverseString
    • DESCRIPTION: Write a function that reverses a string.
    	reverseString('hello world!') //=> '!dlrow olleh'

Participating

  1. Clone this repo
  2. Install all dependencies via npm install.
  3. Fill all challenges in ./src/challenges.js.
  4. Test them via npm run test.
  5. Share the challenge on twitter via #jschallenges
  6. Some ideas? Read below the contributing paragraph or open an ISSUE!

Contributing

  1. Clone this repo.
  2. Install all dependencies via npm install.
  3. Write down your challenge (with solution) in ./src/challenges.js.
  4. Write a test for your challenge in ./test/_your-challenge.js.
  5. Import your test in the test.js file.
  6. Test your challenge via npx ava ./test/_your-challenge.js.
  7. Move your solution to ./src/solutions.js.
  8. Submit your PR!

Contributing notes

All challenges need to follow this scheme:

(2 spaces between each challenge)

    /** 
     * CHALLEBGE <n>: <CHALLENGE-NAME>
     * @name <functionName>
     * @description <challenge-description>
     * @author <Your Name> <you[at]domain.com>
     * 
     * 
     * @example Usage:
     * functionName(args) //=> output
     * 
     * 
     * @param {Type} a ...
     * @param {Type} b ...
     * 
     * @returns {Type} ... 
    */
    module.exports.challenge_name = function() {}

If your challenge is taken from forums please link the thread or the stackoverflow question with @see

READ MORE ABOUT JSODC here

Related


Twitter โ€ข Instagram โ€ข GitHub

js-challenges's People

Contributors

certainperformance avatar gosantos avatar jas7457 avatar rosyatrandom avatar tahseenio avatar paralax avatar

Stargazers

 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.