Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

I want Actors in JavaScript

Name: ppp 2012-02-21 2:53

got any?

Name: Anonymous 2012-02-21 15:28

JavaScript

'' == '0' //false
0 == '' //true
0 == '0' //true
false == 'false' //false
false == '0' //true
false == undefined //false
false == null //false
null == undefined //true

" \t\r\n" == 0 // true
Math.min() < Math.max(); // false
",,," == Array((null,'cool',false,NaN,4)); // true

new Array([],null,undefined,null) == ",,,"; // true


Math.max(); // -Infinity
Math.min(); // Infinity


var foo = [0];
foo == foo  // true
foo == !foo // true



function toInt(number) {return number && + number | 0 || 0;}
toInt("1");  // 1
toInt("1.2");  // 1
toInt("-1.2");  // -1
toInt(1.2);  // 1
toInt(0);  // 0
toInt("0");  // 0
toInt(Number.NaN);  // 0
toInt(1/0);  // 0


[] + [] // ""  (array plus array equals empty string)
[] + {} // [object Object]
{} + [] // 0
{} + {} // NaN
"S" - 1 // NaN

Name: Anonymous 2012-02-21 15:41

Buddy, that entire wall of shit makes sense if you understand the language. If you need exactitude, ===, problem solved.

And you'd have to be a moron to do a naive comparison on array or object datatypes and expect it to magically give you back what you "really want".

Name: Anonymous 2012-02-21 16:14

>>4
You're a moron.

Name: Anonymous 2012-02-21 16:15

>>3
the future of programming! embrace the web!

Name: Anonymous 2012-02-21 16:27

>>3
How could you forget that NaN is not equal to itself?

Name: Anonymous 2012-02-21 16:39


[123] == 123 //true


wtf?

Name: Anonymous 2012-02-21 16:42

>>8
[123][0] == 123[0] //false

Name: Anonymous 2012-02-21 16:49

how bout this one


var a = [0];
a == a;     // true
a == !a;    // true

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List