What is the best way for Javascript code to tell whether it is running in a browser or in NodeJS?
I'm looking for something which will evaluate to a boolean.
Trying to access window
and catching the exception seems rather clinky. Is there a better way?