ECMAscript 4 was supposed to bring these features to Javascript, but it ended up dead due to standards-committee politics:
http://ajaxian.com/archives/ecmascript-edition-4-brendan-spe...
http://weblogs.mozillazine.org/roadmap/archives/2007/10/open...
Re:Miguel De Icaza: CLI on the Web.
by fauigerzigerk on Tuesday May 04, 2010 @02:22AM
(#1317281)
No, not just due to standards-committee politics. Many people didn't like ECMAScript 4 for good reason. I read the spec. It's monstrous. I have hardly ever seen a language with so many overlapping, redundant, completely pointless language features. I'm glad it's dead and I hope it doesn't become undead one day.
Pertinent example: Flash improved its performance enormously from AS2 (ActionScript) to AS3, and one thing they did was add type info. Pertinent because AS is JS.