You can't emulate Nim's strings which are mutable and utf8 with JS strings 
which are immutable and utf16. So instead Nim uses JS array of integers acting 
as bytes (0 to 255) to implement strings.

JS strings have a ton of crazy properties which Nim strings don't have. See 
[https://mathiasbynens.be/notes/javascript-unicode](https://mathiasbynens.be/notes/javascript-unicode)

But some times using JS strings in JS compile mode is useful I have defined 
some methods to make it easier and faster: 
[https://github.com/treeform/jsutils/blob/master/src/jsutils/strings.nim](https://github.com/treeform/jsutils/blob/master/src/jsutils/strings.nim)

Reply via email to