News for hackers. Stuff that matters.
Re:Destructuring Assignment in ECMAScript 6 by xhrpost on Thursday August 15, 2013 @03:45PM (#6220112)
Definitely looking forward to this as well as other new ES6 stuff. There's something else I feel I could use perhaps even more but I haven't seen it in any of the ES* updates. I'm a huge advocate of DRY and it bothers me when I have to code something like:

  var a = objImUsing.prop.someLongName > 5 ? objImUsing.prop.someLongName : whatever;
I can and sometimes just make an extra variable above for a long prop list like this but that adds an extra line. I guess what I would like would be some sort of implied line limited scope:

  var a = objImUsing.prop.someLongName > 5 ? _1 : whatever;
_1 referring to the first mentioned value in the immediate parent statement.
Re:Destructuring Assignment in ECMAScript 6 by ptgloden on Thursday August 15, 2013 @03:56PM (#6220181)
In ES6, you can write more terse immediately invoked function expressions. So you could use

  var a = (prop => prop > 5 ? prop : whatever)(objImUsing.prop.someLongName)
rather than

  var a = (function (prop) { return prop > 5 ? prop : whatever })(objImUsing.prop.someLongName)
Re:Destructuring Assignment in ECMAScript 6 by mook on Friday August 16, 2013 @01:24AM (#6222318)
In older versions of Firefox, you could write: var a = #1=objImUsing.prop.someLongName > 5 ? #1# : whatever; but it's been killed since Firefox 12: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Shar...