Advertisement
Spocoman

02. Nums 1...10

Aug 21st, 2024
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function num1To10 () {
  2.     console.log(1);
  3.     console.log(2);
  4.     console.log(3);
  5.     console.log(4);
  6.     console.log(5);
  7.     console.log(6);
  8.     console.log(7);
  9.     console.log(8);
  10.     console.log(9);
  11.     console.log(10);
  12. }
  13.  
  14. ИЛИ:
  15.  
  16. function num1To10 () {
  17.     for (let i = 1; i < 11; i++) {
  18.         console.log(i);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement