2 var $export = require('./_export')
3 , html = require('./_html')
4 , cof = require('./_cof')
5 , toIndex = require('./_to-index')
6 , toLength = require('./_to-length')
7 , arraySlice = [].slice;
9 // fallback for not array-like ES3 strings and DOM objects
10 $export($export.P + $export.F * require('./_fails')(function(){
11 if(html)arraySlice.call(html);
13 slice: function slice(begin, end){
14 var len = toLength(this.length)
16 end = end === undefined ? len : end;
17 if(klass == 'Array')return arraySlice.call(this, begin, end);
18 var start = toIndex(begin, len)
19 , upTo = toIndex(end, len)
20 , size = toLength(upTo - start)
21 , cloned = Array(size)
23 for(; i < size; i++)cloned[i] = klass == 'String'
24 ? this.charAt(start + i)