On Aug 15, 2007, at 9:58 AM, Ken Snyder wrote:
> Tom Gregory wrote:
>> apply: function(iterator, attribute, value) {
>> return this.map(function(item, index) {
>> item[attribute] = value;
>> });
>> },
>>
> I've run into a need for this as well. I'd vote for including it
> under
> a name 'setAll' or 'setEach'.
I've pretty much talked myself out of the need for it, using invoke
and writeAttribute instead, although a shortcut would be nice. In
order to be useful for dealing with arrays of Elements, it should
probably leverage the new writeAttribute (to take advantage of
Element._attributeTranslations) if Elements are detected. If it was
done that way, why not be keep things simple and call it
'writeAttribute' (similar to Jeff's suggestion).
> Or, what is the exact opposite of pluck? Pin? Place? Affix? :P
Plant?
TAG
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---