String at()
String.at() finds character at specified index, supports positive and negative indexes. Positive indexes start from array start, negative from end.
Syntax:
let a = str.at(ind);
Example: In this example, we will use the String.at() method with a positive index.
Javascript
let str1 = "Welcome to w3wiki" ; let str2 = "w3wiki" ; console.log(str1.at(3)); console.log(str2.at(8)) |
c G
ECMAScript 2021 (JS 2021/2022)
JavaScript in 2021/2022 continues to evolve, with ES2021/ES2022 bringing enhanced features like private class fields, promise improvements, and record data structures, boosting developer productivity and code quality.