Javascript - Challenge
Code Life
By Pierre Marsaa
Battle Preparation
The game loads a Codémon from a save file, but the file is incomplete. Fill in the blanks and get it ready to fight.
Step 1: destructure saved into name, type and level, with type falling back to "normal" and level falling back to 1.
Step 2: print "Loaded: name (type) Lv.X".
Step 3: build ready, a new object made of every property of saved, plus hp worth 50 and status worth "ok".
Step 4: print "Ready: X HP, status Y" from ready, then "Save untouched: X" with the number of keys the original still has, using Object.keys(saved).length.
Expected output:
Loading editor...
↗️
Loading editor...
↶
↷
💡 Show Solution
Continue