Non-decimal radices/Convert: Difference between revisions
Content added Content deleted
(→{{header|JavaScript}}: ES6) |
(→ES6: (updated primitive – replaced recursive until with iterative until)) |
||
Line 1,574: | Line 1,574: | ||
// until :: (a -> Bool) -> (a -> a) -> a -> a |
// until :: (a -> Bool) -> (a -> a) -> a -> a |
||
const until = (p, f, x) => { |
const until = (p, f, x) => { |
||
let v = x; |
|||
while (!p(v)) v = f(v); |
|||
return v; |
|||
} |
} |
||