Why does javascript allow me to do the following.
a = {two : 'World'};
a[1] = 'Hello';
console.log(a[1]);
console.log(a.two);
the output is
Hello
World
Shouldn't it complain that I am trying to use an object as an Array? This works with anything by the way, like so
b = new Date();
b[1] = 'Wow';
console.log(b[1]);
the output is
wow
Is there a use for this? It seems to me like a bad programing practice.