ActionScript 3 Opposite of the “is” Reserved Keyword
-
25-06-2021 - |
Question
Just to slake my curiosity, what is the opposite of the is
reserved keyword in ActionScript 3, as shown in this example:
if (myObject is ArrayCollection) {
//Do stuff...
} else {
//Do something else...
}
So that I could do something like this:
if (myObject isnotoperator ArrayCollection) {
//Do something else...
} else {
//Do stuff...
}
Thank you for your time.
Solution
I don't believe there is one. Instead I prefix the statement with the boolean not operator like so:
if (!(myObject is ArrayCollection)) {
//Do stuff...
} else {
//Do something else...
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow