Skip to content
Junior–Senior166 views

Extracting functions from an array using destructuring

Task condition

It is necessary to demonstrate how to call functions that are inside an array returned from another function.

function obtain() {
  return [
    () => { console.log('Hello') },
    () => { console.log('Hello_2') }
  ];
}

Describe a way to access these functions (for example, through destructuring) and how to call them afterward.

Frontend tasks in the code trainer