I created an array which contains query string values from url
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars[hash[0]] = hash[1];
}
If I want to iterate it, won't happens anything:
$.each(query_array, function(k, v) {
console.log(v);
});
Then I wrote
console.log(query_array.length);
But my array looks like in Chrome console:
[keyword: "mercedes", redirectTo: "test.aspx", remove: function]
The length returns 0. Why ?
How could I iterate through this kind of array ?