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
let data = {key: 'John'}; console.log( data.hasOwnProperty('key') );