I currently have some JS, which checks the user agent (iOs or not) and sets some variables according to the result. So, I have something like:
var isOnIOS = navigator.userAgent.match(/iPad/i)|| navigator.userAgent.match(/iPhone/i);
var eventName_unload = isOnIOS ? "something_if_true" : "something_if_false";
var eventName_load = isOnIOS ? "something0_if_true" : "something0_if_false";
Now, I have to do another check, for Samsung briswer like so:
var isOnSamsung=navigator.userAgent.match(/SAMSUNG|Samsung|SGH-[I|N|T]|GT-[I|N]|SM-[A|N|P|T|Z]|SHV-E|SCH-[I|J|R|S]|SPH-L/i)
and I would like to create a multiple ternary here to something like so:
var eventName_unload = isOnIOS ? "something_if_true" : "something_if_false" :: isOnSamsung ? "somethingX_if_true" : "somethingX_if_false";
Obviously, the above is not correct (just pseudo-code), and I was wondering what is the correct syntax to invoke multiple ternary operator to achieve this.
thank you.