I am trying to pass an array through jQuery's ajax
. The problem is that when I try to pass the array created in JavaScript to JSON
, it returns something empty. I even try console.log
, but when I try to convert it to JSON there is nothing. Here is a representation of how I do it:
var data = [];
data['name'] = 'test';
data['mail'] = 'test';
data['pass'] = 'test';
console.log(JSON.stringify(data)); // result []