项目原始demo,不改动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 

13 lines
479 B

  1. // 21.1.3.7 String.prototype.includes(searchString, position = 0)
  2. 'use strict';
  3. var $export = require('./_export');
  4. var context = require('./_string-context');
  5. var INCLUDES = 'includes';
  6. $export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String', {
  7. includes: function includes(searchString /* , position = 0 */) {
  8. return !!~context(this, searchString, INCLUDES)
  9. .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
  10. }
  11. });