Here's my JS snippet, which is all part of a VAR call.
$showNextMonth,
$showNextMonthFunction = new function() {
if ($monthsLeft <= 9) {
$showNextMonth = '+1'
} else {
$showNextMonth = '0'
}
},
As you can see, i'm population $showNextMonth based of the IF condition. While this works, it seems sloppy. How could i use a Return, an then just use $showNextMonthFunction where i need to.
I'm sure this is a dupe, but i couldn't find a fit, so if there is one, please let me know.
newas you're assigning a function to a variable, not creating an instance of a object.