check if property exists javascript and overwrite it code example Example: check if js property exists in class myObj.hasOwnProperty(myProp)