I vaguely remember that I've seen custom values for a boolean true/false sometimes, but I have no idea what it is called or how exactly it was written.
So I have this code:
preferenceHotel = document.getElementById('preference-hotel').checked;
Now instead of preferenceHotel
returning true or false, I would like it to return other values (yes or no), without writing an if statement checking whether it is true or false.
I remember something like this:
preferenceHotel = document.getElementById('preference-hotel').checked:"yes"|"no";
Does anybody know what I mean and know the name of it so I can read the documentation? (+ write it for my use case).
Thanks in advance!