esnext.string.at.js 307 B

1234567891011
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var charAt = require('../internals/string-multibyte').charAt;
  4. // `String.prototype.at` method
  5. // https://github.com/mathiasbynens/String.prototype.at
  6. $({ target: 'String', proto: true }, {
  7. at: function at(pos) {
  8. return charAt(this, pos);
  9. }
  10. });