Function which will limit the Amount of Element stored in the Array during pushing a new Element. If the Maximum is exited the Elementes will be removed with the FIFO Principal.
In this example the limit will be reached.
const a = [1,2,3,4,5]limitedPush(a, 6,5) // => [2,3,4,5,6];
The limit wont be excided
const a = [1,2,3,4,5]limitedPush(a, 6, 10) // => [1,2,3,4,5,6];
The considered Array
The Element which should be added
The Max. Amount of Elements, which are allowed to store.
Generated using TypeDoc
Function which will limit the Amount of Element stored in the Array during pushing a new Element. If the Maximum is exited the Elementes will be removed with the FIFO Principal.
Example 1:
In this example the limit will be reached.
Example 2:
The limit wont be excided