charAt
can give wrong results for Unicode. Use Array.from
:
Array.from('some string')[0];
More Related Contents:
- Array value is replaced when second one stores in php
- Why is bracket notation not working here? [duplicate]
- How to create these webpages
- Get the element with the highest occurrence in an array
- javascript document.getElementsByClassName compatibility with IE
- What underlies this JavaScript idiom: var self = this?
- Good ways to improve jQuery selector performance?
- Why am I seeing an “origin is not allowed by Access-Control-Allow-Origin” error here? [duplicate]
- prototype: deep scope of “this” to access instance’s scope
- How do I auto-reload a Chrome extension I’m developing?
- Remove hash from url
- An index signature parameter type cannot be a union type. Consider using a mapped object type instead
- JavaScript scope and closure
- Moment.js gives Invalid date in Firefox
- Callback function after tooltip / popover is created with twitter bootstrap?
- CSS: Change parent on focus of child
- Attach event listener through javascript to radio button
- Ember transition & rendering complete event
- An error has occured in ‘site url’: Uncaught TypeError: Cannot read property ‘getColomnSet’ of undefined with Selenium and Python
- Typescript Promise rejection type
- Difference of using async / await vs promises?
- Javascript / Chrome – How to copy an object from the webkit inspector as code
- How to trigger change when using the back button with history.pushstate and popstate?
- performance.now() vs Date.now()
- Uncaught Invariant Violation: Rendered more hooks than during the previous render
- Is there any way to find an element in a documentFragment?
- Map/Set to maintain unique array of arrays, Javascript
- javascript and string manipulation w/ utf-16 surrogate pairs
- Return object with default values from an array in JavaScript
- I would like to mimick conditionals in javascript regex