Echo JS 0.11.0

<~>
chris-l 3790 days ago. link parent 1 point
No, is not a bug. The Array.prototype.slice() is a generic method and can be used with array-like objects.

"The slice function is intentionally generic; it does not require that its this value be an Array object."

It pretty much works with any object that has a "length" property.

Keep in mind he is using it with ".call()", so he can use that object as "this".

Read about it here: http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.10

Replies