Git Product home page Git Product logo

fsp-workshop's Introduction

fsp-workshop

๐Ÿ—’ Excercises for Functional Style Programming

Requirements

The only requirement for this to run is to have Node.js > 8

Running the exercises

To run the exercises just type

node index.js

In order not to confuse with results, only the basic exercise is run. It refers to type-of-fruit.js, which will look like:

>>>>>> ๐Ÿ  Start tests.
        ๐Ÿ›‘  Oops! A bug is eating Red Apples... ๐ŸŽ ... ๐Ÿ›
        ...
        ...

How to solve the exercises

All the exercises are under the exercises folder. Let's take type-of-fruit.js.

Every exercise has a set of data prepared for you. You will need to inspect to pass the challenge.

It'll be bit like childood math. You can think each step as if it were a question: Alba has a basket of candies. How many blue candies are there? And so on...

So, the file starts witht the data:

const {
    applesList,
    fruitsList,
} = require('./res/fruitsLists');

Below, you will see some variables declared (default to undefined) and then exported. They will be used to check the results.

let onlyRedApples;
let onlyGreenApples;

// ...

module.exports = {
    onlyGreenApples,
    onlyRedApples,
    // ...
};

In order to solve the challenge, you will need to set those variables to the correct answer, staritng from the given data. It's up to you how you get to the result.

The aim of this is to prove a Functional Programming Style more useful and ergonomic.

This is the reason I've provided you with some typical method used in this style to be found in utils/fx.js. Be aware that those are not at all a sufficient and you will need to figure out how to use them (I've tried to add most meaningful documentation).

If you wish to have an overview of more complete libraries and helpers for that, check ramda (it's also good for inspiration).

Have fun ๐Ÿ™Œ

Supporting

I believe in Unicorns ๐Ÿฆ„ Support me, if you do the same.

License

MIT License

Copyright (c) 2018 A (from Sicily)

fsp-workshop's People

Watchers

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