The Shape Shifter
Easy+20 XP
Mission Briefing
The shape-shifting mimic has entered the arena! You must demonstrate your ability to track its changing forms by updating a tracker variable.
The Concept: Dynamic Reassignment
Unlike const, variables declared with the let keyword are mutable. They can be updated and reassigned to hold new values as the program runs.
The Objective
Your function receives a parameter newValue.
- Declare a variable named
datausingletand initially set it to "Old". - Reassign the
datavariable to hold the string provided innewValue. - Return the
datavariable.
01EXAMPLE 1
Input
newValue = "Dragon"Output
"Dragon"Constraints
- Use let for declaration.
FundamentalsVariables
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
newValue"Dragon"
Expected Output
Dragon
Click RUN to test your solution