Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(number) {
- for (let i = 0; i < number; i++) {
- let angleChar = '';
- let currentRow = '';
- angleChar = i === 0 || i === number - 1 ? '+' : '|';
- currentRow += angleChar;
- for (let x = 0; x < number - 2; x++) {
- currentRow += ' -';
- }
- console.log(`${currentRow} ${angleChar}`);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement