let array = [];
function getCheckboxes(checkbox) {
let addRandomCheckbox = new RandomAdd(checkbox);
array.push(addRandomCheckbox);
return array;
}
let getValue = getCheckboxes();
console.log(getValue); // returns nothing
This returns nothing…but if I do console.log(array) inside the function; there are some value inside the array.