I have an array. But I can't print that array at all. I am almost madly for this type of array behaviour. Please help me how to print that array.
It seems to be an empty array. But It is an array. When I click that array I see that result.
When I move cursor the icon i
it gives me a message.
value below was evaluated just now
This is my code
var selectedVal = [];
$('body').on('click', '.carat ', function () {
$(".single-progress-mark").show();
$('.carat ').removeClass("active");
$(this).addClass("active");
var det = $(this).attr('data-attr-details');
async: false;
$('.Carat1').text(det);
selectedVal.push({
Carat : det
});
});
console.log(selectedVal);
This is my console.log
output. But I want to print 0.30. I want many ways to print that.
like console.log(selectedVal[0].carat);
or console.log(selectedVal[0]['carat']);
It always gives me undefined
or error.
So please help me how to print my desired output 0.30