<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/javascript-range-how-to-create-an-array-of-numbers-with-from-in-js-es6-i2dtq0lki" -->

---
title: JavaScript Range – How to Create an Array of Numbers...
description: The method is a static method of the object in JavaScript ES6. It creates a new, shallow-copied Array instance from an array-like or iterable object like and....
canonical: https://daily.dev/posts/javascript-range-how-to-create-an-array-of-numbers-with-from-in-js-es6-i2dtq0lki
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: JavaScript Range – How to Create an Array of Numbers with .from() in JS ES6 | daily.dev
og:description: The method is a static method of the object in JavaScript ES6. It creates a new, shallow-copied Array instance from an array-like or iterable object like and....
og:url: https://daily.dev/posts/javascript-range-how-to-create-an-array-of-numbers-with-from-in-js-es6-i2dtq0lki
og:image: https://api.daily.dev/og/posts/i2dtq0lKI.png
og:image:alt: JavaScript Range – How to Create an Array of Numbers with .from() in JS ES6
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# JavaScript Range – How to Create an Array of Numbers with .from() in JS ES6

**[freeCodeCamp](https://daily.dev/sources/freecodecamp)** · [@olawanlejoel](https://daily.dev/olawanlejoel) · 4 min read · 12 upvotes · 0 comments

## Summary

The method is a static method of the object in JavaScript ES6. It creates a new, shallow-copied Array instance from an array-like or iterable object like and. This method returns an array from any object with a length property. You can use it to create an array of numbers within a specified range.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.freecodecamp.org/news/javascript-range-create-an-array-of-numbers-with-the-from-method/>

---

Tags: [#javascript](https://daily.dev/tags/javascript)

[View this post on daily.dev](https://daily.dev/posts/javascript-range-how-to-create-an-array-of-numbers-with-from-in-js-es6-i2dtq0lki)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"JavaScript Range – How to Create an Array of Numbers with .from() in JS ES6","url":"https://daily.dev/posts/javascript-range-how-to-create-an-array-of-numbers-with-from-in-js-es6-i2dtq0lki","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/javascript-range-how-to-create-an-array-of-numbers-with-from-in-js-es6-i2dtq0lki"},"datePublished":"2022-12-14T23:06:27.159Z","dateModified":"2022-12-14T23:06:27.052Z","description":"The method is a static method of the object in JavaScript ES6. It creates a new, shallow-copied Array instance from an array-like or iterable object like and....","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/9196d814e1a99d68c537319af1331e05","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/9196d814e1a99d68c537319af1331e05","isAccessibleForFree":true,"articleSection":"freeCodeCamp","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Olawanle Joel","url":"https://daily.dev/olawanlejoel","image":"https://avatars.githubusercontent.com/u/57611810?v=4","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":390}},"commentCount":0,"discussionUrl":"https://daily.dev/posts/javascript-range-how-to-create-an-array-of-numbers-with-from-in-js-es6-i2dtq0lki","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":12},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"javascript","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"freeCodeCamp","item":"https://daily.dev/sources/freecodecamp"},{"@type":"ListItem","position":3,"name":"JavaScript Range – How to Create an Array of Numbers with .from() in JS ES6"}]}
```

