LoginSignup
2
1

More than 1 year has passed since last update.

JavaScriptでオブジェクトをマージする方法(ES6)

Last updated at Posted at 2019-02-19

JavaScriptでオブジェクトをマージする方法(ES6)

ES6では次のように簡単に書くことができます。

const obj = { a:1, b:2 }
const objToMerge = { c:3, d:4 } 
const merged = {...obj, ...objToMerge}
console.log(merged) // { a:1, b:2 c:3, d:4 } 

終わりに

私は現在、Web3のサービスの開発をしています。詳しくはこちらの記事をご覧下さい。
無料でイーサリアムが当たる、Web3時代の寄付サイトを作った話

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