Returns an array containing the initial elements which both input arrays have in common.
A common use-case for this is discovering common ancestors between two file paths.
> commonSequence = ;> pathA = "/Users/lloyd/Documents/75lb/dmd";> pathB = "/Users/lloyd/Documents/75lb/array-tools";> ;'/Users/lloyd/Documents/75lb'
or a more trivial example:
> a1 2
commonSequence(a, b) ⇒
Returns the initial elements which both input arrays have in common
Kind: Exported function
||first array to compare|
||second array to compare|
This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.
const arrayify =
Within Node.js with ECMAScript Module support enabled:
Within an modern browser ECMAScript Module:
Old browser (adds