I have this in my javascript:
console.log(filters); console.log('----'); console.log(filters.max_price);
In Chrome, this shows. This behavior is expected .
Object {max_price: undefined, sort_by: undefined, distance: undefined, start: undefined, num: undefined} ---- undefined
In IE8, the log shows this:
LOG: Object Object ---- LOG: String
Why does IE8 think this is a string? I need to know if it is undefined.
I have a lot of code that sets default values.
if(typeof filters.max_price == undefined){
How can I check undefine-ds in IE8? Should I do this? It seems to work (yay ...), but it seems cheap and hacked.
if(!filters.max_price || typeof filters.max_price == 'undefined'){
Is there an easy way to do this with underscore ?
source share