Skip to content

Instantly share code, notes, and snippets.

View zhangwenwen12138's full-sized avatar

jackwwzhang zhangwenwen12138

  • 腾讯
  • shenzhen
View GitHub Profile
@zhangwenwen12138
zhangwenwen12138 / ch01-magic-run.js
Created February 22, 2021 12:51 — forked from luijar/ch01-magic-run.js
Functional Programming in JavaScript Chapter 01 - run function
/*
* Functional Programming in JavaScript
* Chapter 01
* Magical -run- function in support of Listing 1.1
* Author: Luis Atencio
*/
// -run- with two functions
var run2 = function(f, g) {
return function(x) {
return f(g(x));