fork download
  1. // your code goes here
  2. function soal1(init) {
  3. let arrx = [];
  4. for (let i = 0; i <= init; i++) {
  5. if (i % 3 === 0 && i % 5 === 0) {
  6. arrx.push(i);
  7. } else if (i % 3 == 0) {
  8. arrx.push(i);
  9. } else if (i % 5 == 0) {
  10. arrx.push(i);
  11. }
  12. }
  13. return arrx;
  14. }
  15. soal1(25);
  16.  
Success #stdin #stdout 0.04s 16884KB
stdin
Standard input is empty
stdout
Standard output is empty