There can be multiple reasons of having undefined values
Object does not exist. Like you create an object of a control which does not exists in your page and when you access it, it is undefined.
No value is assigned to the object.
If you are trying to access a property which does not exists for the object.