Functions

Argument Order

Argument Order

Arguments are matched to parameters by position. JavaScript does not look at the meaning of the value and move it to a better parameter name.

Read this code:

js
function formatTicket(prefix, number) {
  return prefix + "-" + number;
}

const ticket = formatTicket(42, "BUG");

Your task: Predict the exact string stored in ticket.

Prerequisites

  • variables
  • strings
  • functions

Tests

  • prediction follows positional argument matching
  • prediction is not rearranged by parameter meaning
Loading...
Console

Run code to see output.