Jump to content

Longest common prefix: Difference between revisions

m (→‎JS ES6: Updated primitives and output.)
Line 1,901:
// allSame :: [a] -> Bool
const allSame = xs =>
// True if xs is empty, or every item in the
// tail of the list is identical to the head.
0 === xs.length || (() => {
const x[h, ...t] = xs[0];
 
return xst.every(yx => xh === yx);
})();
 
9,659

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.