Skip to content

Instantly share code, notes, and snippets.

@mpj
Created May 31, 2018 15:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpj/2bfd436b363f6e8572e6ce9e28b7dd18 to your computer and use it in GitHub Desktop.
Save mpj/2bfd436b363f6e8572e6ce9e28b7dd18 to your computer and use it in GitHub Desktop.
const fs = require('fs')
fs.readFile('hello.txt', 'utf8', (error, content) =>
content
.split('\n')
.filter(line => line.includes('dog'))
.forEach(line => console.log(line))
)
fluffykins is a dragon
wolfbane is a dragon
kittylunch is a cat
karo is a dog
multidog is a dog
@misterhtmlcss
Copy link

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!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment