I want to create an array of hashes in javascript. In other words, I want to do the following thing
var messages = new Array; messages['info'].push(["info message1", "info message2", "info message3"]); messages['error'].push(["error message1", "error message2", "error message3"]);
and then iterate through each key. But it gives me an error "Cannot call method 'push' of undefined"
How can I do it?