Add parentheses to Array.prototype.map

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-09-06 14:51:50 +03:00
parent 75206e59d5
commit e84fcda901
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ tags: components,array,beginner
Renders a list of elements from an array of primitives.
- Use the value of the `isOrdered` prop to conditionally render a `<ol>` or `<ul>` list.
- Use `Array.prototype.map` to render every item in `data` as a `<li>` element, give it a `key` produced from the concatenation of the its index and value.
- Use `Array.prototype.map()` to render every item in `data` as a `<li>` element, give it a `key` produced from the concatenation of the its index and value.
- Omit the `isOrdered` prop to render a `<ul>` list by default.
```jsx

View File

@ -6,7 +6,7 @@ tags: components,array,beginner
Renders a table with rows dynamically created from an array of primitives.
- Render a `<table>` element with two columns (`ID` and `Value`).
- Use `Array.prototype.map` to render every item in `data` as a `<tr>` element, consisting of its index and value, give it a `key` produced from the concatenation of the two.
- Use `Array.prototype.map()` to render every item in `data` as a `<tr>` element, consisting of its index and value, give it a `key` produced from the concatenation of the two.
```jsx
const DataTable = ({ data }) => {