Created
March 8, 2019 00:27
-
-
Save BrambleXu/268ce0c57154db17b3efc7422323028e 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
var fs = require('fs'); | |
var text = fs.readFileSync('./unicode_plane.txt'); | |
var lines = text.toString().split('\n') | |
for (i=0; i < lines.length; i++) { | |
// console.log(lines[i].split(' ')); | |
unicode_char = lines[i].split(' ')[0]; | |
count = lines[i].split(' ')[1]; | |
// test for not use spread operator | |
// if (unicode_char.length !== parseInt(count)) { | |
// console.log(unicode_char, count, unicode_char.length.toString()) | |
// }; | |
// test for spread operator | |
if ([...unicode_char].length !== parseInt(count)) { | |
console.log(unicode_char, count, [...unicode_char].length.toString()) | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment