Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="it-IT">
- <head>
- <meta charset="UTF-8">
- <title>Unicode</title>
- </head>
- <body>
- <script>
- const s1 = "A";
- const s2 = "遰";
- const s3 = "ciao";
- const s4 = "🚀";
- console.log(s1.length);
- console.log(s2.length);
- console.log(s3.length);
- console.log(s4.length);
- console.log(s3.charCodeAt(0));
- console.log(s3[0]);
- console.log("\u{9070}");
- console.log(s2.charCodeAt(0));
- console.log(s2[0]);
- console.log(s4.charCodeAt(0));
- console.log(s4.charCodeAt(1));
- console.log(s4[0]);
- console.log(s4[1]);
- console.log(s4[0]+s4[1]);
- console.log("\u{d83d}\u{de80}");
- console.log( s4.codePointAt(0) );
- console.log( s4.codePointAt(1) );
- console.log("\u{1f680}");
- console.log("\u{de80}");
- console.log('mañana' === 'mañana'); //https://mathiasbynens.be/notes/javascript-unicode
- console.log('mañana'.length + " " + 'mañana'.length);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement