Junior — Senior
Determine what will be output to the console (example 6)
livecode
Task condition
It is necessary to understand what value of the variable index will appear in the console output.
function get() {
const index = 'cat';
return {
fn1: () => { console.log(index) },
fn2: () => { console.log('Hello_2') }
}
}
const { fn1: a, fn2: b } = get();
console.log(a());