Javascript - Unicode

About

javascript is encoding this character in unicode UTF-16

See also: HTML - Unicode Character

Cheatsheat

  • \u00A0 whitespace

Syntax

Literal

console.log('\u00E9');
console.log('\uD83D\uDE00');

where:

fromCodePoint

Example with the grinning face emoji. This character has the unicode code point:

let grinningFaceHexa = String.fromCodePoint(0x1F600);
let grinningFaceDeci = String.fromCodePoint(128512);
console.log('HexaDecimal grinning face '+grinningFaceHexa);
console.log('Decimal grinning face '+grinningFaceDeci);

Output:

where:


Powered by ComboStrap