'I want to print a pattern with emojis
I wrote this code for a pattern to log into the console. it works just fine with & and * symbols but when I want to replace & with 🌑 and replace * with 🌕 , the code no longer works properly. what should I do?
function pattern(n) {
for (let i = 5; i > 0; i--) {
console.log("&".repeat(i).padStart(n, "*"));
}
}
pattern(5);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
