123456789101112 |
- let strSpace = ' ';
- let strHash = '#';
- let strResult = '';
- let strHashLength = 5;
- let strSpaceLength = 6;
- for (let i = 1, j = 1; i <= strHashLength || j <= strSpaceLength; i++, j++) {
- if(j <= strSpaceLength) strResult += `${strSpace}`;
- if(i <= strHashLength) strResult += `${strHash}`;
- }
- console.log(`"${strResult}"`);
|