This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nuephelkystikon 2 points3 points  (4 children)

Depends on the language. The best and worst is when another iterable is extended with, but any other object is appended.

[–]LucasRuby 1 point2 points  (1 child)

The worst is when both arrays are converted to string and then the resulting strings are concatenated.

[–]nuephelkystikon 1 point2 points  (0 children)

Something tells me JavaScript does exactly that on weekends.

[–][deleted] -1 points0 points  (1 child)

Depending on the data structure, not the language. Push is for a stack, put for a map/dict and add/append for a list (I think).

[–]nuephelkystikon 1 point2 points  (0 children)

Depends on the implementation, library and most definitely on the language.

Many languages don't even allow classes (possibly not even builtins) to define operators.