@d-healey said in MIDI player laggy:
Yeah that's what I meant by he might get invalid values, because he wants to check "if something exists" not if it's true or false - or at least that's what I got from the statement.
Yeah, true (no pun intended). To check if something is defined I'd always use isDefined() because it's more readable and explicit.
But I do use !! a lot in other places because it's so consistent in what it returns.
And !! does return false for undefined, for reference.
Console.print(isDefined(somethingUndefined)); // 0
Console.print(!!somethingUndefined); // 0