You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get a **`configurable`** amount of items when iterating over a JavaScript array, instead of a single item that arrays provide per iteration, by default.
3
+
Get a **`configurable`** amount of items when iterating over a JavaScript array, instead of a single item that arrays provide per iteration, by default.
4
+
5
+
Put differently, easily and safely retrieve a configurable number of items from an array, without having to manipulate array bounds or indices.
4
6
5
7
6
8
## Motivation
7
9
8
10
Imagine that you received a large collection of coordinates (latitude and longitude), but they were sent
9
11
as a flat array of values to speed up the data transfer.
10
12
11
-
`n-tuple-array` can help you get out the coordinates in pairs (i.e their logical representation), such that you'd go
13
+
`n-tuple-array` can help you get out the coordinates in pairs (i.e their logical representation), such that you'd __easily__go
I first tried my hands on this concept when [fleshing out wole-joko](https://github.com/chalu/wole-joko/blob/dev/src/js/utils.js#L57-L92), which strated as a _live coding task_ I was asked to do in an engineering manager interview :man_shrugging
49
-
It was a simulation of people entering an event hall to get seated, but **only two** could get in at a time - https://wole-joko.netlify.app/
50
-
51
-
#### 2. Execute max of `N` async tasks
52
-
53
-

54
-
55
-
> The below was adapted for more concise terminal output
I first tried my hands on this concept when [fleshing out wole-joko](https://github.com/chalu/wole-joko/blob/dev/src/js/utils.js#L57-L92), which strated as a _live coding task_ I was asked to do in an engineering manager interview :man_shrugging
93
+
It was a simulation of people entering an event hall to get seated, but **only two** could get in at a time - https://wole-joko.netlify.app/
94
+
95
+
#### 2. Execute max of `N` async tasks at the same time
96
+
97
+

98
+
99
+
> The below was adapted for more concise terminal output
0 commit comments