New ES6 strawman: Array.prototype.fill and Array.prototype.move

Axel Rauschmayer axel at rauschma.de
Sun Jun 23 13:14:46 PDT 2013


>> Array.prototype.move = function move(target=0,source=0, count=this.length-source)
>> Is the case of moving trailing elements somewhere else very common? If not, then I’d define the parameters in this order: source, count, target.
>> Rationale: easier to memorize.
> 
> No, assignment-expression LHS/RHS (target/source) order precedent wins for memorization (see Object.extend precedent, strcpy, memcpy, etc.).


That makes sense, thanks!

I was thinking System.arraycopy, which may not a good precedent:
http://docs.oracle.com/javase/6/docs/api/java/lang/System.html#arraycopy%28java.lang.Object,%20int,%20java.lang.Object,%20int,%20int%29

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130623/fd414979/attachment-0001.html>


More information about the es-discuss mailing list