We can use the slice method of arrays, which like the other methods mentioned above is "intentionally generic" and so can be used with array-like objects, like this
Podemos usar el slice método de matrices, que al igual que los otros métodos mencionados anteriormente es "intencionalmente genérico" y, por lo tanto, se puede utilizar con objetos tipo array, como este
JavaScript has powerful semantics for looping through arrays and array-like objects.
The only native, array-like objects are strings, although they are not suitable in applications of this method, as strings are immutable.
Los únicos objetos nativos que se asemejen al array son strings objetos, aunque estos no se puedan usar en la aplicación de este método ya que son inmutables.
Note: Most browsers, including Chrome 14 and Internet Explorer 9, still do not accept array-like objects and will throw an exception.
Nota: La mayoría de los navegadores, incluidos Chrome 14 e Internet Explorer 9, aún no soportan el uso de objetos similares a un arreglo y arrojarán una excepción.
Other results
The arguments of a function are maintained in an array-like object.
Specification Returns an array-like object of all child elements which have all of the given class names.
Retorna un objecto similar a un array de los elementos hijos que tengan todos los nombres de clase indicados.
Using the arguments object The arguments of a function are maintained in an array-like object.
Es posible invocar los argumentos de una función utilizando el objeto arguments.
Function.apply() can accept any array-like object as the arguments list, instead of only true arrays.
Function.apply() puede aceptar cualquier objeto estilo-array como lista de argumentos, en lugar de solo arrays reales.
The other way (introduced in ECMAScript 5) is to treat the string as an array-like object, where individual characters correspond to a numerical index
El otro modo es tratar la cadena como un arreglo (vector), donde cada índice se corresponde con un carácter individual
Potentially sensitive or inappropriate content
Examples are used only to help you translate the word or expression searched in various contexts. They are not selected or validated by us and can contain inappropriate terms or ideas. Please report examples to be edited or not to be displayed. Potentially sensitive, inappropriate or colloquial translations are usually marked in red or in orange.