Choose which callback to run.

Callback Branches

callback_branch.js
const amount = 6;
const limit = 5;
const labels = [amount].map((value) => value <= limit ? "small:" + value : "large:" + value);

console.log("amount=" + amount);
console.log("label=" + labels[0]);
callback-branch Callbacks can contain choices. Here the callback maps a value to one of two labels.