I want to create a object with a specific name and an array, (e.g. myObject = { name : array()}). I have this code :
$(".selectedQueues").each(function(){
var selectionName = $(this).find("input").val();
var containedQueues = new Array();
$(this).find("li").each(function(){
containedQueues.push($(this).text());
});
var object = new Object();
object.selectionName = containedQueues;
console.log(object);
});
And when I print the object it is like {selectionName : array[]} , but I want it to be {the value in selectionName : array[]}, can someone help me?
[]as well as..object[selectionName] = containedQueues;