BY Simmi Kava1 Jul 2021 Edit
JavaScript: White Space & Line Terminator Code Points (Unicode)

JavaScript: Unicode Support in JavaScript


What are White Space and Line Terminators?

White Space and Line Terminators code points are used to improve the readability of source code and to separate indivisible lexical units (tokens) from each other. Line terminators influence the syntactic grammar and process of semicolon insertion.

The below source code explains some of the permitted Unicode and what happens when we use trim() function on these Unicode's.

'\tHi WebAtoms\t'.trim(); // <TAB> Or \u0009 - Character Tabulation
'\u000BHi WebAtoms\u000B'.trim(); //<VT> Line Tabulation -Vertical Tab
'\u000CHi WebAtoms\u000C'.trim(); // <FF> Form Feed or '\f'
'\u00A0Hi WebAtoms\u00A0'.trim(); //<NBSP> - No-Break Space
'\uFEFFHi WebAtoms\uFEFF'.trim(); //<ZWNBSP> - Zero Width No Break Space
'\rHi WebAtoms\r'.trim(); //<CR> Carriage Return or \u000D
'\nHi WebAtoms\n'.trim(); //<LF> - Line Feed or \u000A
'\u2028Hi WebAtoms\u2028'.trim(); //<LS> - Line Separator 
'\u2029Hi WebAtoms\u2029'.trim(); //<PS> - Paragraph Separator 
'\u2001Hi WebAtoms\u2001'.trim(); //Em Quad alias Mutton Quad

For more details on White Space and Line Terminator, visit the ECMA Script link:-

ECMA Script: ECMA Script Reference

The unicode u2001 belongs to the Other Category "Zs". When I stumbled upon the unicode support in Javascript, I landed on this blogpost, which also explains other functions and "Zs" category unicode.

Blog Post: Unicode Support In JavaScript

Another reference: JavaScript Character Escape Sequences

Hope these resources are helpful. Happy Learning!

BY Simmi Kava
LikeCommentSave
LikeCommentSaveShare
0
Categories
General
YantraJS
Developer Guides
Tutorials
Web Atoms Updates

POPULAR POSTS
17 Mar 2021
LATEST ACTIVITY
Simmi Kava
commented this post.
Simmi Kava
liked this post.
Show more
ARCHIVES
2024
2023
2022
2021
TAGS
javascript (56)
developer (25)
javascriptdeveloper (16)
Xamarin.Forms (16)
Html (14)
typescript (12)
webatoms (12)
xamarin (11)
coding (10)
web-atoms (10)
arrays (9)
android (8)
javascript-developer (8)
csharp (7)
dotnet (7)
css (6)
update (6)
dotnet-standard (5)
function (5)
iOS (5)
methods (4)




Web Atoms: JSX (TSX + TypeScript) for Xamarin.Forms, Hot Reload Your App in Production Environment

PlaygroundSamples Repository