Skip to content

Instantly share code, notes, and snippets.

@TravisMullen
Created August 11, 2018 20:21
Show Gist options
  • Save TravisMullen/178d4712c8b613df41e41b35ec087bac to your computer and use it in GitHub Desktop.
Save TravisMullen/178d4712c8b613df41e41b35ec087bac to your computer and use it in GitHub Desktop.
get Unicode values of character
// get Unicode values of character items in an array
function getCharactersUnicodeValue(characters) {
const unicodeChart = new Map();
characters.forEach(character => {
unicodeChart.set(
character,
character.charCodeAt(character.indexOf(character))
);
});
console.table(unicodeChart);
}
// get unicode values of a single character
function getCharacterUnicodeValue(character) {
const value = character.charCodeAt(character.indexOf(character));
console.log(value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment