11_chess_one_line.js 208 B

12345678910
  1. let strSpace = ' ';
  2. let strHash = '#';
  3. let strResult = '';
  4. let strLength = 12;
  5. for(let i = 1; i < strLength; i++) {
  6. strResult += (i % 2 === 0) ? strHash : strSpace
  7. }
  8. console.log(`"${strResult}"`);