this only works as long as the strings do not contain unicode characters
const x = 'H🍺llo' console.log( x.charAt(0) ) // H console.log( x.charAt(1) ) // � console.log( x.charAt(2) ) // � console.log( x.charAt(3) ) // l console.log( x.charAt(4) ) // l // di naapektuhan yung original string console.log( x ) // H🍺llo const chars = 'H🍺llo'.match(/./ug); console.log(chars[0]); //H console.log(chars[1]); //🍺 console.log(chars[2]); //l console.log(chars[3]); //l console.log(chars[4]); //o
Ohh I see, that's very insightful, I'll edit the all the string-related blogs to become aware of this, Thank you so much! <3
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
this only works as long as the strings do not contain unicode characters
Ohh I see, that's very insightful, I'll edit the all the string-related blogs to become aware of this, Thank you so much! <3