1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

開眼!JavaScriptの2.4のまとめ プロパティの削除

Last updated at Posted at 2015-04-11

開眼!JavaScriptの2.4のまとめです。

##2.4 delete演算子でプロパティを削除する。
delete演算子で、指定したプロパティをオブジェクトから削除することができる。(ただし、プロトタイプチェーンで継承するプロパティは削除しない。)

プロパティを指定して削除を実行。(プロトタイプチェーンで継承するプロパティは削除できていない。)

var foo = {bar:'bar'};
delete foo.bar;
console.log('bar' in foo);
delete foo.toString;
console.log('toString' in foo);

結果
false
true

1
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?