es6.array.join.js 453 B

123456789101112
  1. 'use strict';
  2. // 22.1.3.13 Array.prototype.join(separator)
  3. var $export = require('./_export');
  4. var toIObject = require('./_to-iobject');
  5. var arrayJoin = [].join;
  6. // fallback for not array-like strings
  7. $export($export.P + $export.F * (require('./_iobject') != Object || !require('./_strict-method')(arrayJoin)), 'Array', {
  8. join: function join(separator) {
  9. return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);
  10. }
  11. });