This repository was archived by the owner on Jun 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
$.range()
Arthur Guiot edited this page Aug 16, 2017
·
4 revisions
This function is made to create an array containing every integer between 0 and the number you choose. Which means that if you choose 5, this function will return you:
[0, 1, 2, 3, 4, 5]This function will be super useful when you're dealing with these kinds of for loop:
for (let i in array) {
...
}By the way, this for loop can be emulated by the $.forIn() function.
So, as an example, let's show how you can use the $.range() function in this kind of for loop:
JS:
for (let i in $.range(10)) {
console.log(`Iteration ${i}`)
}Don't hesitate to ask your questions
- Home
- The Core Languages
- Getting Started: Installation
- The Basics (
$.var()+$.target()) - Developing for DisplayJS
-
$.select()- Text related
- If...else
$.xss()$.repeat()$.custom()$.live()$.load()$.on()$.onEvent()$.ready()- Scroll API
$.all()$.clone()$.is()$.valEmpty()$.remove()$.show()&$.hide()$.ajax()- Class Related
$.css()$.getStyle()- Fade effects
$.extend()$.dynamic()$.parent()- Elements-Nodes
$.component()$.time_ago()$.copy()$.then()$.sleep()$.getProp()