Sobes.tech
Back to tasks
Junior — Senior
23

Определите, что будет выведено в консоль (пример 6)

Get help with live coding in real time with Sobes Copilot
Task condition

Нужно понять, какое значение переменной index окажется в выводе консоли.

function get() {
  const index = 'cat';
  return {
    fn1: () => { console.log(index) },
    fn2: () => { console.log('Hello_2') }
  }
}

const { fn1: a, fn2: b } = get();

console.log(a());