Travis build: 2040
This commit is contained in:
@ -2992,11 +2992,14 @@ zipWith(
|
|||||||
|
|
||||||
Converts the given array elements into `<li>` tags and appends them to the list of the given id.
|
Converts the given array elements into `<li>` tags and appends them to the list of the given id.
|
||||||
|
|
||||||
Use `Array.map()` and `document.querySelector()` to create a list of html tags.
|
Use `Array.map()`, `document.querySelector()`, and an anonymous inner closure to create a list of html tags.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const arrayToHtmlList = (arr, listID) =>
|
const arrayToHtmlList = (arr, listID) =>
|
||||||
arr.map(item => (document.querySelector('#' + listID).innerHTML += `<li>${item}</li>`));
|
(el => (
|
||||||
|
(el = document.querySelector('#' + listID)),
|
||||||
|
(el.innerHTML += arr.map(item => `<li>${item}</li>`).join(''))
|
||||||
|
))();
|
||||||
```
|
```
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -6,8 +6,10 @@ Use `Array.map()`, `document.querySelector()`, and an anonymous inner closure to
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
const arrayToHtmlList = (arr, listID) =>
|
const arrayToHtmlList = (arr, listID) =>
|
||||||
(el => (el = document.querySelector('#' + listID),
|
(el => (
|
||||||
el.innerHTML += arr.map(item => `<li>${item}</li>`).join('')))()
|
(el = document.querySelector('#' + listID)),
|
||||||
|
(el.innerHTML += arr.map(item => `<li>${item}</li>`).join(''))
|
||||||
|
))();
|
||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|||||||
Reference in New Issue
Block a user