I\'m trying to take some data from an existing object and group it into a new one. The problem I am having is checking if the object key exists so I can either create a new
I have run into this pattern a lot, and what I end up doing is:
if (object[key]) { //exists } else { // Does not exist }
so I think in your case it will be:
if (groups[group_key]) { // Exists } else { // Does not exist }