Tag Archives: variable

626 views

JS check if variable or function exist javascript

Use typeof // var nMyVariable = 0; // try comment and uncomment this row   if(typeof nMyVariable === ‘undefined’ ){ alert("Variable not exist"); }ele{ alert("Variable exist"); }   ////////////////////////// // chcek if function exist function myFunciton (){ alert("Hello Space!"); } … Continue reading

Posted in Javascript css html | Tagged | Comments Off on JS check if variable or function exist javascript