Last active
June 6, 2019 13:25
-
-
Save sky172839465/b3f761ac2a9e87a519f112955c1bd6ff to your computer and use it in GitHub Desktop.
Generate nine nine table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
let contents = '' | |
for (let i = 1; i <= 9; i++) { | |
let row = [] | |
for (let j = 1; j <= 9; j++) { | |
row.push(`${i} x ${j} = ${i * j}`) | |
} | |
contents += `|${row.join('|')}|\n` | |
} | |
const table = | |
`|||||||||| | |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | |
${contents} | |
` | |
fs.writeFileSync('./nine-nine-table.md', table, 'utf8') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment