UNPKG

array-includes-polyfill

Version:

Exposing a richer set of Array features for JavaScript

32 lines (24 loc) 708 B
var array = require('../src/array-includes-polyfill-es6'); var chai = require('chai'); var expect = chai.expect; describe('Copy Prototype', function () { it('should copy data to another array', function(){ var destination = []; var arr = new array(); arr.push(10); arr.push(20); arr.push(30); arr.copy(destination); console.log(destination) expect(destination.length).equals(3); }); it('should generate a new array', function(){ var arr = new array(); arr.push(10); arr.push(20); arr.push(30); var destination = arr.copy(); console.log(destination) expect(destination.length).equals(3); }); });