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
$.flatten()
Arthur Guiot edited this page Jul 12, 2017
·
1 revision
This function is the opposite of $.reshape(). Instead of creating 2d arrays from a 1d array, the $.flatten() will create a 1d array from a 2d array, like that:
[[0, 1], [2, 3], [4, 5]]
// |
// v
[0, 1, 2, 3, 4, 5]It's pretty simple, you simply need to give as an argument a 2d array.
Let's reproduce what I showed you before:
JS:
$.flatten($.reshape($.range(5), 2)) // [0, 1, 2, 3, 4, 5]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()