Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

functional.js

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

functional.js

A functional JavaScript library that facilitates currying and point-free programming, with optional lambda expressions.

  • 0.7.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

functional.js (fjs) Build Status npm version devDependency Status

functional.js is a functional JavaScript library.

It facilitates currying and point-free / tacit programming, with optional lambda expressions.

Documentation

Visit functionaljs.com for the full documentation including curry, each, map, reduce, fold, apply, every, any, select, pluck, toArray, first, last, best, partition, group, while and more.

Curry function example

var add = fjs.curry(function(arg1, arg2) {
    return arg1 + arg2;
});

var add3 = add(3);

add(1, 2, 3); // => 6
add3(1, 2, 3, 4, 5); // => 18

Curry expression example

var add = fjs.curry("a, b => a + b");

var add3 = add(3);

add(1, 2, 3); // => 6
add3(1, 2, 3, 4, 5); // => 18

Real world example

var converter = fjs.curry(function(rate, symbol, input) {
    var output = input * rate;
    return symbol + output.toFixed(2);
});

var poundsToUSD = converter(1.52, "$");
var poundsToEUR = converter(1.27, "€");

poundsToUSD(100); // => "€63.50"
poundsToEUR(50); // => "$152.00"

License

MIT License

Keywords

FAQs

Package last updated on 23 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc