Complete the code to call the function before its declaration.
console.log([1]()); function greet() { return 'Hello!'; }
The function greet is hoisted, so you can call it before its declaration.
Complete the code to assign a function expression and call it.
const sayHi = [1]() { return 'Hi!'; }; console.log(sayHi());
Function expressions use the keyword function to assign a function to a variable.
Complete the code to call the function expression correctly.
const greet = function() { return 'Hello!'; };
console.log([1]());Function expressions are not hoisted, so call them after assignment. The variable name is greet.
Fill both blanks to create a function expression and call it.
const add = [1](a, b) [2] a + b; console.log(add(2, 3));
Use function to define the function expression and { return for the body with explicit return.
Fill all three blanks to create a function expression and call it.
const multiply = [1](x, y) [2] x * y; console.log([3](4, 5));
This code defines a function expression named multiply and calls it correctly.
