I am looking to assign rlPrice to either 0 (if undefined) or to the defined price which would be available. This below will do it ok.
if($('#rl option:selected').data("unit-price") == undefined){
rlPrice = 0;
else{
rlPrice = $('#rl option:selected').data("unit-price");
}
However is there a way to do it with ternary operators?
rlPrice = $('#rl option:selected').data("unit-price") OR 0;