☃ as a Namespace
@dharden
Can you use ☃ as a JavaScript namespace?
Thank you, @mathias and @eevee
Code Points
- U+0000 to U+10FFFF
- 0000 to FFFF = Basic Multilingual Plane (BMP)
- 010000 to 10FFFF = Supplementary or Astral Plane
- ☃ = U+2603
- D = U+0044
- 💩 = U+1F4A9
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.
DAN - U+0044 U+0041 U+004E
>> console.log('\x44\x41\x4e');
DAN
ಠ_ಠ - U+0CA0 KANNADA LETTER TTHA
>> console.log('\u0cA0');
ಠ
🍕 U+1F355 SLICE OF PIZZA
>> 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
>> console.log('\ud83c\udf55');
🍕
https://mathiasbynens.be/notes/javascript-identifiers-es6
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.
thank you, https://mathiasbynens.be/notes/javascript-identifiers, http://stackoverflow.com/questions/1661197/what-characters-are-valid-for-javascript-variable-names
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?
☃ as a Namespace
@dharden