Created
March 7, 2019 12:54
-
-
Save BrambleXu/3b15a6869d2c2db98be00a4a6b04b837 to your computer and use it in GitHub Desktop.
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
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