How do I check if a value is NaN?

Try this:
if value ~= value
Source of this answer:

33 Likes