remove key if exists js code example
Example 1: js remove key from object
// Example 1
var key = "Cow";
delete thisIsObject[key];
// Example 2
delete thisIsObject["Cow"];
// Example 3
delete thisIsObject.Cow;
Example 2: nodejs delete object key
delete obj.firstname;