Define then call

Take your time, follow the code and check your understanding.

Move blocks into orderFunctions
  1. console.log(double(4));
  2. };
  3.   return n * 2;
  4. const double = n => {
Your answer3 min · no timer

Drag blocks, or use the arrow buttons. Keep the displayed indentation. This task uses the taught sequence; other equivalent programs may also be valid.

Show solution and explanation

The const function expression must be initialised before it is called.

const double = n => {
  return n * 2;
};
console.log(double(4));