JavaScript Coding Question – 11

  • Object.assign(obj2, obj1) : merges obj1 properties into obj2.( adding the properties from obj1 into obj2 directly.)
  • Object.keys(obj2): Gets the keys of the modified obj2.
  • Since obj1’s keys (a and b) are added to obj2, result includes all keys from both objects.

Leave a comment