Created
September 23, 2018 19:15
-
-
Save ceme/d3540cc090eb65c9270abfd56f75ff75 to your computer and use it in GitHub Desktop.
Chain Map Filter Reduce and output to DOM : JavaScript / HTML / CSS
This file contains hidden or 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
<div id="out"></div> |
This file contains hidden or 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
const x = [0,1,2,3,4,5,6,7,8,9] | |
.map((elm) => elm * 12) | |
.filter((elm) => elm > 42) | |
.reduce((sum, n) => sum += n) | |
document.querySelector('#out').appendChild(document.createTextNode(`Hello there: ${x}`)) |
This file contains hidden or 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
* { | |
color: magenta; | |
font-weight: bold; | |
font: 1.3em "Open Sans", sans-serif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment