How will Ecma-262 (EcmaScript 5) help you?
EcmaScript Fifth Edition, or Ecma-262, has been announced and contains some changes to the language. What features in the new version are going to help you write better code? ...
EcmaScript Fifth Edition, or Ecma-262, has been announced and contains some changes to the language. What features in the new version are going to help you write better code? ...
ECMAScript 5 is in final draft now, and includes new features relating to objects and prototypes. While hunting around SO and Google for OOP design patterns, I found that there were quite a few different ways of "doing OOP" (however you might define OOP, from trying to emulate classical OOP to simply trying to cut down namespace polluti...
ECMAScript 5 is in its final draft as I write this; It is due to include a strict mode which will prevent you from assigning to the global object, using eval, and other restrictions. (John Resig's Article is a good introduction.) This magical sanity-saving mode is triggered by including the string "use strict" at the top of your file (o...
Although Ecmascript 5 introduces some completely new features, it also adds some new methods (bind, trim, map, etc.) which should be perfectly possible to implement (albeit slower) in current versions. Does a library exist which implements these backwards compatible features (and no more, excluding Prototype et. al.) ...
Does anybody know why, at the end of section 7.6 of the ECMA-262, 5th Edition specification, the nonterminals UnicodeLetter, UnicodeCombiningMark, UnicodeDigit, UnicodeconnectorPunctuation, and UnicodeEscapeSequence are not followed by two colons? From section 5.1.6: Nonterminal symbols are shown in italic type. The definition of ...
According to the spec (Annex C), strict-mode code can't do pretty much anything that might assign any identifier with the name eval. I can understand that one might want to restrict use of the actual eval function, but I don't see what purpose is served by restricting use of the name? ...
So Safari and Chrome have started in their betas to implement some ES5 stuff. For instance Object.create is in them. Do any of you know if there is a website that shows the progress made in the browsers? ATM i need to use Object.freeze, and wanted to see which browsers (if any) supported that yet. ...
What scope does the strict mode pragma have in ECMAScript5? "use strict"; I'd like to do this (mainly because JSLint doesn't complain about it): "use strict"; (function () { // my stuff here... }()); But I'm not sure if that would break other code or not. I know that I can do this, which will scope the pragma to the function... ...
Possible Duplicate: Javascript: use strict Is there any way to know how and which browsers support it? ...
In JavaScript, why does an octal number string cast as a decimal number? I can cast a hex literal string using Number() or +, why not an octal? For instance: 1000 === +"1000" // -> true 0xFF === +"0xFF" // -> true 0100 === +"0100" // -> false - +"0100" gives 100, not 64 I know I can parse with parseInt("0100" [, 8]), but I'd like to ...
ECMAScript 5 has quite a few nice additions. John Resig has a good overview here. Here is a good ECMAScript 5 compatibility table. A lot of this stuff can be "faked" for browsers that don't support these functions yet. Do you know of any scripts that can do this? I'm particularly interested in Object.create. For example, Douglas Crock...
How can I specify a default getter for a prototype? With default getter I mean a function that is called if obj.undefinedProperty123 is called. I tried Object.prototype.get = function(property) {..} but this is not called in this case. ...
A long time ago, I saw someone encapsulate their entire javascript block with code something like the code below: <html> <body> ... <script> (function(){ ... })(this); </script> </body> </html> Questions: Is the code above correct? What benefit is there to encapsulating the entire javascript block like denoted above? ...
I'm seeing posts about a 'new' Object.create that makes enumeration configurable. However, it relies on a Object.defineProperty method. I can't find a cross browser implementation for this method. Are we stuck writing for the old Object.create? I can't write things that won't work in IE6/7. ...
So ECMAScript 5 introduces some incompatibilities with ECMAScript 3. Example: Many articles have been written stating that this === null || this === undefined is possible in ES5 strict mode: "use strict"; (function () { alert(this); // null }).call(null); But, what the standard really suggests is that ES5 engines also allow th...