@cmarmar/

ObviousCleanLanservers

ES6

No description

fork
loading
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const alternate = (cb) => {
  let calls = 0
  return () => {
    calls++
    if(calls%2===1){
      return cb()
    }
  }
}

let message = ''

let sayHeyOnAlts = alternate(()=> message+= 'hey')

sayHeyOnAlts()
console.log(message)
sayHeyOnAlts()
console.log(message)
sayHeyOnAlts()
console.log(message)
sayHeyOnAlts()
console.log(message)
Babel Compiler v6.4.4 Copyright (c) 2014-2015 Sebastian McKenzie