After the seat-ledger demo, make a different closure: a spending desk. makeBudget(startingBalance) returns a spend(amount) function that subtracts affordable expenses and returns the new balance. If there is not enough money, return null and leave the balance unchanged. Use positive amounts and nonnegative starting balances in this exercise. Work only in script.js; Run shows your checkpoints in the Console.
This separate example shows a closure keeping a message prefix, not money:
function makeTag(prefix) {
return function (word) { return `${prefix}: ${word}`; };
}
const label = makeTag("Review");
console.log(label("ready")); // Review: ready
makeBudget(startingBalance) returning a spending function.null without deducting them.Independent: 8,19 by spending from two fresh budgets.Backstage Toolkit complete: your functions now combine results, supply defaults, and remember private state. Take the section quiz before moving to arrays.
Read each expected Console line, then build it from your function calls.