( already covered to receive stones )
```javascript
Object.defineProperty(
Object.prototype,
'through',
{
enumerable: false,
configurable: true,
writable: true,
value: function through(callback) {
for (var a = [this], i = 1; i < arguments.length; a[i] =
arguments[i++]);
return callback.apply(null, a);
}
}
);
```
so that ..
```javascript
window.HTMLFormElement.prototype.through(Object.getOwnPropertyDescriptor,
'elements').get
document.querySelectorAll('input[type=checkbox][name=
Select_ID]:checked').through(Array.from).map(e => e.value).join(',')
```
Last, but not least, I don't see any concrete advantage/need neither ^_^
Best Regards
On Tue, May 27, 2014 at 10:12 AM, C. Scott Ananian <[email protected]>wrote:
> I like the idea, but I agree that the .{ } syntax isn't quite right. For
> one thing, on my screen the () are visually very similar to {}, while []
> are easily distinguished. The leading dot is also a bit odd. I'd be
> interested in seeing some more alternative syntaxes for this idea.
> --scott
>
>
> On Tue, May 27, 2014 at 8:54 AM, Claude Pache <[email protected]>wrote:
>
>>
>> Le 27 mai 2014 à 17:04, Jasper St. Pierre <[email protected]> a
>> écrit :
>>
>> >
>> > (...) Namely, the whole ('elements') looks like a method call
>> containing one argument, rather than having a secret hidden argument as its
>> first.
>> >
>>
>> Yes, it was exactly intended to appear as such, making
>> `obj.{Object.getOwnPropertyDescriptor}('elements')` similar to
>> `obj.hasOwnProperty('elements')`, for instance. If it helps, you could
>> think of `foo.{Bar.baz}` as defining a temporary method:
>> `(function(...args) { return Bar.baz(this, ...args) })`, or:
>> `Bar.baz.bind(Bar, foo)`.
>>
>> —Claude
>>
>> _______________________________________________
>> es-discuss mailing list
>> [email protected]
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss