I wanted to get the value of chkArray variable when called outside the method.
When I called getValues().total from outside the method I am getting a error message as cannot read property total of undefined.
function getValues(){
chkArray = new Array() ;
$("input[type=checkbox]:checked").each(function fire() {
var total = chkArray.push($(this).val());
console.log(chkArray)
});
};
Kindly, help how to call that variable outside the method
.totalcomes in..totalisn't defined anywhere.