DEV Community

Discussion on: Challenge: Write a program that never stops

Collapse
danielescoz profile image
Daniel Escoz • Edited on

Javascript (ES6):

const zero = () => Promise.resolve(0).then(zero);
zero().then(result => console.log('this does not print a zero:', result));

Technically ends because .then run on the next tick, but it permanently blocks the JS event loop (I think).

(It might eat your RAM)