1
0

【JavaScript】オブジェクトから指定したプロパティを削除する方法

Posted at

以下のようにdelete演算子を使用すると指定したプロパティを削除できます。

const obj = {
  name: "Name",
  age: 32,
}

delete obj.age; 

console.log(obj) // {name: "John"}

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0