Answers for "does object exist js"

1

how to check if object exists in javascript

if (typeof maybeObject != "undefined") {
   alert("GOT THERE");
}
Posted by: Guest on May-14-2020
1

javascript check if function exists

if (typeof sourceObj.someMethod === "function") { 
    // you are safe using the method
  	sourceObj.someMethod();
}
Posted by: Guest on May-02-2020

Code answers related to "does object exist js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language