Skip to content

Instantly share code, notes, and snippets.

@BrambleXu
Created March 7, 2019 12:54
Show Gist options
  • Save BrambleXu/3b15a6869d2c2db98be00a4a6b04b837 to your computer and use it in GitHub Desktop.
Save BrambleXu/3b15a6869d2c2db98be00a4a6b04b837 to your computer and use it in GitHub Desktop.
var fs = require('fs');
var text = fs.readFileSync('./emoji_length.txt');
var lines = text.toString().split('\n')
for (i=0; i < lines.length; i++) {
// console.log(lines[i].split(' '));
emoji = lines[i].split(' ')[0];
count = lines[i].split(' ')[1];
// test for not use spread operator
// if (emoji.length !== parseInt(count)) {
// console.log(emoji, count, emoji.length.toString())
// };
// test for spread operator
if ([...emoji].length !== parseInt(count)) {
console.log(emoji, count, [...emoji].length.toString())
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment