Code Lab BetaBUILD. RUN. DISCOVER.
Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
Challenges / 03
Wallet Status.
Your lesson
Write remaining(budget, spent) returning budget - spent. Write budgetStatus(left): if left < 0 → "over"; if left < 50 → "low"; otherwise → "ok". Given: budget = 200, spent = 165. Call remaining, store the result in left, log left and budgetStatus(left). Expected output:
35
low
JS Foundations finale: two return functions and status thresholds. Do not hardcode 35/"low".
challenge_03.jsJAVASCRIPT
Loading the runtime… The first launch may take a little longer.
… 0/20000
CHECKSSTANDBY
01remaining and budgetStatus are functions
02left is 35; status is low
03console shows 35 and low
…0/10000
ConsoleWrite the code. Bring it online.
›