JavaScript Isset
if (typeof foo !== 'undefined') {
}
Grepper
if (typeof foo !== 'undefined') {
}
if (typeof obj.foo !== 'undefined') {
}
if (typeof obj.foo !== 'undefined') {
// your code here
}
if (obj.hasOwnProperty('foo')) {
// your code here
}