showing results for - "currying vs closure javascript"
Raymond
10 May 2017
1function closure(){
2    function first() { console.log('I was declared first')}
3    function second() { console.log('I was declared second')}
4    function third() { console.log('I was declared third')}
5    return [first, second, third]
6}
Ashby
08 Feb 2016
1let f = closure()
2
3let one = f[0]
4let two = f[1]
5let three = f[2]
6
7one() // logs I was declared first
8two() // logs I was declared second
9three() // logs I was declared third
Krista
10 Aug 2018
1function closuredFunc (){
2    function closure(){
3    // some logic
4    }
5}