<p>How do I check if an object property in JavaScript is undefined?</p>

```
```
if (somevariable == undefined) {
  alert('the variable is not defined!');
}
```
```
You can also make it into a function, as shown
here
:
```
```
function isset(varname){
  return(typeof(window[varname]) != 'undefined');
}
```
```