Solve the no connection puzzle: Difference between revisions
m
→ES6
m (→JS ES6: (deleted redundant primitive)) |
m (→ES6) |
||
Line 965:
// enumFromTo :: Enum a => a -> a -> [a]
const enumFromTo = (m, n) => {
const [tm, tn] = [typeof m, typeof n];
return tm !== tn ? undefined : (() => {
const
blnS = (tm === 'string'),
[base, end] = [m, n].map(blnS ?
return Array.from({
length: Math.floor(end - base) + 1
|