Solve the no connection puzzle: Difference between revisions

m
m (→‎JS ES6: (deleted redundant primitive))
Line 965:
// enumFromTo :: Enum a => a -> a -> [a]
const enumFromTo = (m, n) => {
const [tm, tn] = [typeof m, typeof n];
codePoint = s => s.codePointAt(0),
[tm, tn] = [typeof m, typeof n];
return tm !== tn ? undefined : (() => {
const
blnS = (tm === 'string'),
[base, end] = [m, n].map(blnS ? codePoint(s => s.codePointAt(0)) : id);
return Array.from({
length: Math.floor(end - base) + 1
9,659

edits