I'm looking to create a simple multiplication table using React. I've got the following code where I'm trying to loop through an array.
{array.map((num) => {
return (
<tr>
<th>{num}</th>
{array.map((x) => {
return <td>{x}</td>;
})}
</tr>
);
})}
I'm getting the error 'num.map is not a function'
I understand that num is not a function, but I wanted to check if there is a way I could basically create a nested loop? If not, my alternative would be to convert a string to JSX, but I wanted to check whether there's a way I could achieve this with map first.
num.mapnot not being call in the code you shared...