Last active
February 9, 2021 07:22
-
-
Save SirmaXX/483224ccc6132ff51c8384fb5da2fcca to your computer and use it in GitHub Desktop.
multiplication and counting table with react.js
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
import React from "react"; | |
function NumberTable() { | |
const row = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; | |
const col = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11]; | |
return ( | |
<div> | |
{col.map((ncol) => ( | |
<tr>{ | |
row .map(mrow => (<td>{mrow * ncol}</td> | |
))} | |
</tr> | |
))} | |
</div> | |
); | |
} | |
export default NumberTable; |
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
import React from "react"; | |
function NumberTable() { | |
const row = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; | |
const col = [0, 1, 2,3, 4, 5, 6, 7, 8, 9]; | |
return ( | |
<div> | |
{col.map((ncol) => ( | |
<tr>{ | |
row .map(mrow => (<td> {(mrow + (ncol*10))} </td> | |
))} | |
</tr> | |
))} | |
</div> | |
); | |
} | |
export default NumberTable; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment