I have a variable called loopNum which returns as an object in console. The other variables return as expected. Can anyone explain why this is happening? Thanks
Script
// stores how many carousels there are
var carouselNum = $('.carousella').length;
// stores the product of number of carousels times the increment value
var loopNum = $((carouselNum - 2) * -183);
console.log('loopNum = ' + loopNum);
console.log('carouselNum = ' + carouselNum);
Console
loopNum = [object Object]
Don’t wrap the
carouselNumvariable into a jQuery wrapper$()after assigning it. Try this: