I wrote this blog post about some of the pain points I'm dealing with and dreams of how ES7 might be able to address them:

http://www.nczonline.net/blog/2014/06/03/my-ecmascript-7-wishlist/

A short overview in lieu of posting the whole article here:

* `Array.prototype.first()`, `Array.prototype.last()` - return the first and last items, respectively. * `Array.prototype.isEmpty()` - return true when empty (would also be nice on strings, maps, etc.). * `Function.empty` - a standard empty function that can be used when you just want an empty function (IMHO, it indicates intent much better than other options toda). * Custom descriptor attributes - David mentioned this likely will never happen, which makes me sad. Maybe the decorators proposal solves this use case. * `Object.deepPreventExtensions()`, `Object.deepSeal()`, `Object.deepFreeze()` - deep versions of `Object.preventExtensions()`, et al. * `Object.preventUndeclaredGet()` - change an object's behavior to throw an error if you try to read from a property that doesn't exist (instead of returning `undefine`). * Lightweight traits - simple syntax sugar for object literals and classes to facilitate mixins.

Further rationale and explanation is in the post. The last three, in particular, scratch particular itches I currently have.

**Note:** Please don't take these as formal proposals. If any of the ideas seems worthwhile, I'm happy to discuss further and/or put together an actual proposal.

Thanks.

--
___________________________
Nicholas C. Zakas
http://www.nczonline.net

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to