<article>
<section>
<h1>Hello bber!</h1>
</section>
</article>
const promises = [
new Promise(resolve =>
setTimeout(_ => resolve(('bber!')), 10)
),
new Promise(resolve =>
setTimeout(_ => resolve(('Hello')), 0)
),
];
Promise.all(promises)
.catch(err => console.error(err))
.then(([b, a]) => console.log(`${a} ${b}`))
module Enumerable
def cartesian(other)
res = []
each { |x| other.each { |y| res << [x, y] } }
return res
end
end
import System.Environment
import System.IO
isPrime :: Int -> Bool
isPrime n
| n <= 1 = False
| otherwise = not $ any (\x -> n `mod` x == 0) [2,3..(n-1)]