What is type of foo, if foo != foo?
-
Recently had been debugging using the browser console, when I found this answer. Can you guess the type of foo here? Is it a string, function or else?
How about
int
?private static System.Random randy = new System.Random() ;
int foo { get { return ( randy.Next() ) ; } }:-D
-
How about
int
?private static System.Random randy = new System.Random() ;
int foo { get { return ( randy.Next() ) ; } }:-D
-
spoiler alert -- answer is below Opened Chrome Dev console and ran the following.
var x = 'garbage' / 10;
x
NaNx != x // with coercion
truex !== x // even without coercion
truetypeof(x)
"number"Awesome :thumbsup:
-
Recently had been debugging using the browser console, when I found this answer. Can you guess the type of foo here? Is it a string, function or else?
NaN