Detecting Undefined Variables in JavaScript
This pops up every so often so I thought I’d dedicate a post to it. JavaScript has no “isset” function. Instead, your best bet is to use the following:
if((typeof theVariable) == ‘undefined’)
Insights on the IT world by Michi Kono
Archive for 24th September 2006
This pops up every so often so I thought I’d dedicate a post to it. JavaScript has no “isset” function. Instead, your best bet is to use the following:
if((typeof theVariable) == ‘undefined’)