currying vs closure javascript

JavaScript
function closure(){
    function first() { console.log('I was declared first')}
    function second() { console.log('I was declared second')}
    function third() { console.log('I was declared third')}
    return [first, second, third]
}function closuredFunc (){
    function closure(){
    // some logic
    }
}let f = closure()

let one = f[0]
let two = f[1]
let three = f[2]

one() // logs I was declared first
two() // logs I was declared second
three() // logs I was declared third
Source

Also in JavaScript: