Created
July 8, 2016 18:21
-
-
Save dhyegocalota/2f3ea2d5b4d2f1e55e2a1a0557d82a78 to your computer and use it in GitHub Desktop.
Unique Words (by line)
This file contains 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'); | |
var data = []; | |
var file = fs.readFileSync(process.argv[2], {encoding: 'utf-8'}); | |
file | |
.split('\n') | |
.forEach(x => { | |
if (data.indexOf(x) === -1) { | |
data.push(x); | |
} | |
}); | |
console.log(data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment