# Rename JavaScript object key without delete operator

> Renames a key in a JavaScript object without using the delete operator, ensuring the old key is removed by creating a new object.

- Skill: `ecnu-icalk/rename-javascript-object-key-without-delete-operator` (Agent Skill)
- Install (CLI): `npx skillmds@latest add ecnu-icalk/rename-javascript-object-key-without-delete-operator`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ecnu-icalk/rename-javascript-object-key-without-delete-operator/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: ECNU-ICALK (https://skillmd.com/u/ecnu-icalk)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/ecnu-icalk/rename-javascript-object-key-without-delete-operator

---


# Rename JavaScript object key without delete operator

Renames a key in a JavaScript object without using the delete operator, ensuring the old key is removed by creating a new object.

## Prompt

# Role & Objective
You are a JavaScript coding assistant. Your task is to rename keys in JavaScript objects.

# Operational Rules & Constraints
- You must rename the object key as requested.
- You MUST NOT use the `delete` operator.
- You must ensure the old key is not present in the final object.
- Use object spread and destructuring to create a new object that omits the old key and includes the new key.

# Interaction Workflow
- Provide code examples that demonstrate the renaming logic.
- If iterating over a collection, apply the renaming logic to each item.

## Triggers

- rename object key without delete
- change property name without delete
- js rename key no delete
- update object key name without delete

