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}
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