LoginSignup
1
1

More than 3 years have passed since last update.

Objectのコピー(deep copy)

Posted at

JSON.stringify() メソッドと、JSON.parse() メソッドを使う。

var obj = {name : "yamada", id : "001"};
var copyObj = JSON.parse(JSON.stringify(obj));
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