BVB Source Codes

reactide Show es6.array.slice.js Source code

Return Download reactide: download es6.array.slice.js Source code - Download reactide Source code - Type:.js
  1. 'use strict';
  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;
  8.  
  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);
  12. }), 'Array', {
  13.   slice: function slice(begin, end){
  14.     var len   = toLength(this.length)
  15.       , klass = cof(this);
  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)
  22.       , i      = 0;
  23.     for(; i < size; i++)cloned[i] = klass == 'String'
  24.       ? this.charAt(start + i)
  25.       : this[start + i];
  26.     return cloned;
  27.   }
  28. });
downloades6.array.slice.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top