Bjoern Hoehrmann (2013-10-19T17:15:05.000Z)
domenic at domenicdenicola.com (2013-10-26T03:04:43.712Z)
Allen Wirfs-Brock wrote: > The utility of a hypothetical 'at' method is presumably exactly that of 'codePointAt'. > > ```js > str.at(p) > ``` > > would just be a convenience for expressing > > ```js > String.fromCodePoint(str.codePointAt(p)) > ``` > > So the real question is probably, how common is that use case. Certainly not common enough to warrant a two-character method on the native string type. Odds are people will use it incorrectly in an attempt to make their code look concise, not understanding that it'll retrieve a substring of .length 1 or 2, possibly consisting of a lone surrogate, based on a 16 bit index that might fall in the middle of a character; the problematic cases are fairly rare, so it's hard to notice improper use of `.at` in automated testing or in code review.