Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
2,436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. function trippleLetters(n) {
  2. for(let i = 0; i < n; i++){
  3. let firstLetter = String.fromCharCode(i + 97);
  4. for(let j = 0; j < n; j++){
  5. let secondLetter = String.fromCharCode(j + 97);
  6. for(let k = 0; k < n; k++){
  7. let thirdLetter = String.fromCharCode(k + 97);
  8. console.log(`${firstLetter}${secondLetter}${thirdLetter}`);
  9. }
  10. }
  11. }
  12. // for (let i = 97; i < 97 + n; i++) {
  13. // let firstLetter = String.fromCharCode(i);
  14. // for (let j = 97; j < 97 + n; j++) {
  15. // let secondLetter = String.fromCharCode(j);
  16. // for (let k = 97; k < 97 + n; k++) {
  17. // let thirdLetter = String.fromCharCode(k);
  18. // console.log(`${firstLetter}${secondLetter}${thirdLetter}`);
  19. // }
  20. // }
  21. // }
  22. }
  23.  
  24. trippleLetters(15);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement