Created
May 31, 2018 15:06
-
-
Save mpj/2bfd436b363f6e8572e6ce9e28b7dd18 to your computer and use it in GitHub Desktop.
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 fs = require('fs') | |
fs.readFile('hello.txt', 'utf8', (error, content) => | |
content | |
.split('\n') | |
.filter(line => line.includes('dog')) | |
.forEach(line => console.log(line)) | |
) |
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
fluffykins is a dragon | |
wolfbane is a dragon | |
kittylunch is a cat | |
karo is a dog | |
multidog is a dog |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wish you kept the finished product before you refactor. Maybe push when you finish it in the original context and then when you refactor push a new commit, then we can come here and review them side by side. That would be so awesome, because I find I learn lots by looking at them side by side.
You are a great teacher and so easy to listen too!!