I need to return true or false if an option in a drop down selected.
This is my code:
var active = sort.attr('selected') ? return true : return false;
I get an error that the first return
is unexpected.
Why?
You can return from a ternary operator in javascript like this:
return sort.attr('selected') ? true : false;