Once you realize that there are no associative arrays in JavaScript these things become less of a WTF.
var a = {}; typeof(a.hasOwnProperty) === "function"
Objects are very often used as associative arrays, quite simply becouse objects and arrays are all js has to offer. Javascript Harmony will change that though, with it's own Map type.
PHP != Javascript