Javascript to C# conversion (conditional)

Im trying to figure out a simple Javascript IF statement in C#, but for the life of me i cant work out what its asking in Javascript.

var max : int

if(!max)
  //  other code

What on earth is this in C#? The variable is an int, not a boolean, so to me it makes no sense. Unless its checking if the variable is undefined or something.

Can anyone with Javascript knowledge please lend me some insight into what exactly that code is doing.

Javascript uses something called duck typing, meaning it adapts the type of variables depending on how they are used (this can make it very easy to create errors, and I prefer stronger typing for this reason). In this case, you are using a float as if it is a boolean, so the compiler converts it to a boolean for use in that statement. Generally, numerical values convert to booleans usomg the following rules:

if(v == 0) return false; else return true;