Seperators:
New line is $^$
Sort:
a & b: two elements to be compared.
If return is less than 0, leave a and b unchanged.
If return is 0, leave a and b unchanged with respect to each other, but sorted with respect to all different elements.
If return is greater than 0, sort b before a.
ex: return a - b;
Regex:
ex: /(\w+)/g
Test:
element: The current element being processed.
index: The index of the current element being processed.
array: The array of elements being processed.
ex: return element > (array.length / index);
Custom:
x: The current element being processed.
y: The next element to be processed.
z: The previous element that has been processed.
n: A variable that will be passed to the next execution. Equals 0 at first execution.
array: The elements that are being processed.
index: The current element's index in array.
ex: n = n + x;
return (x + y + z) / (array.length * index);
Back