Deretan angka

Run Settings
LanguageJavaScript
Language Version
Run Command
const hasil = [] for (let i=1; i <= 10; i++) { hasil.push(i) } console.log(hasil.reverse()); const result = [] for (let i=1; i <= 20; i++) { if (i % 2 !== 0) { result.push(i) } } console.log(result); const total = [] for (let i = 1; i < 20; i++) { if (i % 2 === 0 || i === 20 -1) { total.push(i) } } console.log(total); const jumlah = [] let x = 10; for (let i = 1; i <= 10; i++) { jumlah.push(x+=i) } console.log(jumlah);
Editor Settings
Theme
Key bindings
Full width
Lines