@dharden
Can you use ☃ as a JavaScript namespace?
By @dharden
okay but really tho
Thank you, @mathias and @eevee
What is little-known generally is that the "U+" convention itself was an ASCII-fied compromise for what the Unicode designers *really* wanted to use for the Unicode hexadecimal prefix, which was U+228E MULTISET UNION (whose glyph is a union sign with a plus sign in it).
The semantic appropriateness of MULTISET UNION as a designator for Unicode code points ought to be apparent, and the shape of the union symbol itself was iconic for the "U" of Unicode. But use of the symbol in data files and documentation in the early days was problematical, of course, and it soon gave way to the much more practical use of "U+" instead.
okay so javascript
>> console.log('\x44\x41\x4e');
DAN
>> console.log('\u0cA0');
ಠ
>> console.log('\u{1f355}');
🍕
>> var pizza = '🍕';
>> console.log(pizza.length);
2
>> console.log(pizza.charCodeAt(0).toString(16));
d83c
>> console.log(pizza.charCodeAt(1).toString(16));
df55
U+D800 - U+DFFF
JavaScript's strings are unsigned 16-bit integers, so astral plane control points are represented with pairs
U+1F355 SLICE OF PIZZA
http://www.fileformat.info/info/unicode/char/1F355/index.htm
>> console.log('\ud83c\udf55');
🍕
In ES6, identifiers must start with $, _, or any symbol with the Unicode derived core property ID_Start. The rest of the identifier can contain $, _, U+200C zero width non-joiner, U+200D zero width joiner, or any symbol with the Unicode derived core property ID_Continue.
var 〱〱〱〱 = "less than? wtf";
var जावास्क्रिप्ट = "javascript";
var ಠ_ಠ = "disapproval";
var π = Math.PI;
function calculateCircumference(radius) {
return 2 * π * radius;
}
calculateCircumference(1); //6.283185307179586
Can you use ☃ as a JavaScript namespace?
By @dharden