Hacker News new | past | comments | ask | show | jobs | submit login

"append" means adding something to the back end, e.g. appendices in a book are encountered later when sequentially processing the book's pages.

"prepend" is used to describe adding something at the beginning of a sequence.

Good old "cons" has the specific technical meaning of placing data at the lowest address of a sequential memory structure...and it is shorter than "append" and "prepend."




Yes append() and prepend() would be much better names than push() and unshift().

IF JavaScript had them as built-ins it would be great, then I wouldn't need to look for mnemonics for shift() and unshift() :-)

But, I googled "prepend" and guess what: google replied

"Although it sounds correct, prepend is not an English word. It was created to sound like the opposite of "append," which means to add to the end. The correct English word is "prefix".

A slight problem with that is that "prefix" is more often used as a noun than as a verb, I think.


"Prepend" might not be queen's English. I'm American so so what.

Anyway, "cons" is a better term in technical contexts.


'idice' is the specific location context to put at end.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: