freeCodeCamp/guide/english/javascript/standard-objects/array/array-from/index.md

23 lines
398 B
Markdown

---
title: Array from
---
## Array from
The 'Array.from()' method creates a new Array instance from an array-like or iterable object.
### Syntax:
'''
Array.from(arrayLike[, mapFn[, thisArg]])
'''
### Example:
'''
Array.from('foo');
// ["f", "o", "o"]
'''
#### More Information:
[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)