← HALL

Shallow Copy Mutation Hazard

MEDIUM
+250 XP REWARD ⏱ Limit: 10m
// MISSION BRIEFING //

ANOMALY DESCRIPTION

A player inventory cloner uses Object.assign to duplicate a profile. When the clone alters nested inventory items, the original profile is mutated! Implement a deep clone of the object.

SPECIFICATION SUITE

Nested object isolation
Input: {user: 'A', stats: {hp: 100}}
Expected: {user: 'A', stats: {hp: 100}}
Array inside object [PROTECTED TEST]
Evaluation logic hidden to prevent hardcoding.

RADAR HINTS

Hint #1 (Click to decrypt)

Use JSON.parse(JSON.stringify(profile)) or recursive cloning.

solution.js UTF-8 • JAVASCRIPT
STATIC ANALYSIS CONSOLE Ready for dispatch

Press "VERIFY & SUBMIT" or Ctrl+Enter to evaluate your patch.