Han
Member since May 18, 2010
- Profile: /members/6057-han.htm
- URL: http://github.com/laughinghan
- Comments: 4
Recent Blog Comments By Han
-
Javascript's IN Operator Does Not Work With Strings
Posted on Jun 30, 2011 at 4:43 AM
@Han, Damnit, typos, should be: Wait a minute... var str = new String( 'primitive-valued string literal' ); console.log( str.split(' ') ); //=> obviously ["primitive-valued", "string", "literal"] str.split = function(){ return 'overridden!'; }; console.log( st... read more »
-
Javascript's IN Operator Does Not Work With Strings
Posted on Jun 30, 2011 at 4:37 AM
I'm surprised no one else has explained this more clearly, though most of the pieces are scattered throughout the comments. I'm going to start by poking some holes in your tests, and also point out some JavaScript quirks you probably haven't noticed, which I hope will motivate my excruciatin... read more »
-
Javascript's Implicit Boolean Conversions
Posted on Feb 11, 2011 at 3:40 AM
@Victor: http://bclary.com/2004/11/07/#a-11 .9.3 Step 18 would be the culprit here.... read more »
-
Javascript's Implicit Boolean Conversions
Posted on May 18, 2010 at 4:19 PM
This is very clearly spelled out in the ECMAScript spec (section 9.2): http://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262 ,%203rd%20edition,%20December%201999.pdf It's not as clear in the JScript spec, but this appears to be normalizing: http://msdn.microsoft.com/en-us/lib... read more »