Question: ```
alert(typeof QuizParser.Parser.otherdata['response_set']['answers']["slide_" + _index]['trt']);​

```

Why? Shouldn't this simply alert the string `undefined`? If this is wrong, how should I check to see if that variable is defined or not?

Answer: 
When you use `typeof`, it will return `"undefined"` for undefined variables, but in your case you are actually doing other things before calling `typeof`. `QuizParser.Parser.otherdata` must be defined in order for `typeof` to not cause an error. For example, if `x` is not defined, `typeof(x)` is okay but `typeof(x.something)` will cause an error since you are trying to access `x` which is not defined (in order to access something)
It's not the `typeof` that's the issue. It's the fact that inside the `typeof`, before the "typeof" part is actually executed, you're trying to access members of a null object. For example, consider this scenario (and note that it isn't javascript, but it's the idea I'm trying to get across, not the language syntax)

```
public class Test
{
    public string teststring;
}

```

and then you do something like this:

```
Test nullTest; // null

if(typeof(test.teststring) != null)

```

the second the parser sees the dot after test, a nullreference error is thrown, since you're essentially trying to call null.teststring. 
Instead, you have to do something like:

```
if(object != null && object.property != null && object.property.propertyOfTheProperty != null) 
//...

```

so that the execution of the if statement would be broken before anything dangerous could ever happen. If knowing about `object`'s or `property`'s nullness is important to you, you can also do this:

```
if(object != null)
{
    if(object.property != null)
    {
        if(object.property.propertyOfTheProperty != null)
        {
           //...
        }
    }
}

```