Puts the given value under key only if the entry key does not exists in the map.

 

Properties

  • object: Location of the object to add the value
  • key: Key where the value is added
  • value: The value to add

Output

  • output-location: Location to store the output data

For example

Let’s say we want to add the value of ‘3’ in the key ‘a’ of the object {a: 1, b: 2}. This will return {a: 1, b: 2}

Let’s say we want to add the value of ‘2’ in the key ‘b’ of the object {a: 1}. Since the key does not exist, it will create a new element and return {a: 1, b: 2}

0 0 vote
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments