furo-head-tail

furo-head-tail #

@furo/util v2.1.19
import '@furo/util/src/furo-head-tail.js';
exports FuroHeadTail js
exports <furo-head-tail> custom-element-definition
superclass HTMLElement

summary split an array

furo-head-tail Splits an iterable (i.e. Array) in its head and tail part.

 <furo-head-tail fn-split="--arrayData" at-head="--firstElement" at-tail="--restOfArray"></furo-head-tail>

Attributes and Properties #

Events #

at-head{Any}

Fired when Array was splitted, contains the first element of array.

tail #

at-tailArray | Any

Fired when Array was splitted. {Array || Any} is the tail from the injected array (e1 - 1n)

Methods #

split #

split(iterable `` ) ⟹ void

`` fn-split

Splits an iterable to its head (first item) and its tail (the rest) parts.

["a", "b", "c", "d"]
 |_|  |___________|
  ^      ^
  |      |
  |     TAIL   => ["b", "c", "d"]
 HEAD          => "a"
  • iterable