(function(){ for (let i = 1; i < 20; i++){ if ((i % 2) === 0) console.log(i + ' '); } })(); //you don't have to call it, it'll just show you the result