Array.from Array.from (ES2015, but shimmable) creates an array from an array-like object, optionally passing the entries through a mapping function first.
Entonces, por ejemplo, si Array.from (ES2015 +, pero se puede rellenar fácilmente) crea una matriz a partir de un objeto similar a una matriz, opcionalmente pasando las entradas a través de una función de mapeo primero.
Take Array.prototype.slice, for example, which you want to use for converting an array-like object to a real array.
Tomando Array.prototype.slice, por ejemplo, el cual se desearía utilizar para convertir un objeto tipo array a un arreglo real.
Summary An Array-like object corresponding to the arguments passed to a function.
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
Contenu potentiellement sensible ou inapproprié
Les exemples vous aident à traduire le mot ou l’expression cherchés dans des contextes variés. Ils ne sont ni sélectionnés ni validés par nous et peuvent contenir des mots ou des idées inappropriés. Signalez des exemples à modifier ou à retirer. Les traductions potentiellement sensibles, inappropriées ou familières sont généralement marquées de rouge ou d’orange.