I\'ve got an array
var assoc_pagine = new Array(); assoc_pagine[\"home\"]=0; assoc_pagine[\"about\"]=1; assoc_pagine[\"work\"]=2;
var is a statement... so it's a reserved word... So just call it another way. And that's a better way of doing it (=== is better than ==)
if(typeof array[name] !== 'undefined') { alert("Has var"); } else { alert("Doesn't have var"); }