The Purge Protocol
Easy+15 XP
Mission Briefing
The databanks have been compromised! A highly sensitive password property is currently exposed on the user profiles. You must write a purge protocol to wipe it permanently!
The Concept: Object Cleanup
The delete keyword forcefully and permanently removes a key-value property entirely from an object.
Example: delete user.age; // The 'age' property is gone forever
The Objective
Your function receives a user object.
- Use the
deletekeyword to destroy the property exactly named "password". - Return the safely cleaned
userobject.
01EXAMPLE 1
Input
user = { name: "Ali", password: "123" }Output
{ name: "Ali" }Constraints
- Use the delete keyword.
FundamentalsObjects
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
user{"user":"Ali","password":"123"}
Expected Output
{"user":"Ali"}Click RUN to test your solution