Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main(n) {
- for (let i = n - 1; i > 0; i--) {
- let startResult = " "
- startResult += (" ").repeat(i);
- startResult += "* ".repeat(n - i)
- console.log(startResult);
- }
- for (let i = 0; i < n; i++) {
- let startResult = " "
- startResult += (" ").repeat(i);
- startResult += "* ".repeat(n - i)
- console.log(startResult);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement