by xhrpost · 13y ago · 0 comments
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. var a = (prop => prop > 5 ? prop : whatever)(objImUsing.prop.someLongName)
rather than var a = (function (prop) { return prop > 5 ? prop : whatever })(objImUsing.prop.someLongName)