This content moved here: https://exploringjs.com/impatient-js/ch_arrays.html#quickref-arrays
None of the string methods modify this
– they always return fresh strings.
-
charAt(pos: number): string
ES1Returns the character at index
pos
, as a string (JavaScript does not have a datatype for characters).str[i]
is equivalent tostr.charAt(i)
and more concise (caveat: may not work on old engines).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// editor settings | |
"editor.formatOnSave": true, | |
"editor.renderWhitespace": "all", | |
"editor.fontSize": 14, | |
"editor.fontWeight": "500", | |
"editor.lineHeight": 28, | |
"editor.letterSpacing": 0, | |
"editor.fontFamily": "Hack", | |
"editor.insertSpaces": false, |
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
- Use ESM yourself. (preferred)
Useimport foo from 'foo'
instead ofconst foo = require('foo')
to import the package. You also need to put"type": "module"
in your package.json and more. Follow the below guide. - If the package is used in an async context, you could use
await import(…)
from CommonJS instead ofrequire(…)
. - Stay on the existing version of the package until you can move to ESM.
OlderNewer