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.
|
||||
|
||||
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
|
||||
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>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -5,9 +5,11 @@ Converts the given array elements into `<li>` tags and appends them to the list
|
||||
Use `Array.map()`, `document.querySelector()`, and an anonymous inner closure to create a list of html tags.
|
||||
|
||||
```js
|
||||
const arrayToHtmlList = (arr, listID) =>
|
||||
(el => (el = document.querySelector('#' + listID),
|
||||
el.innerHTML += arr.map(item => `<li>${item}</li>`).join('')))()
|
||||
const arrayToHtmlList = (arr, listID) =>
|
||||
(el => (
|
||||
(el = document.querySelector('#' + listID)),
|
||||
(el.innerHTML += arr.map(item => `<li>${item}</li>`).join(''))
|
||||
))();
|
||||
```
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user