ecmascript 6 - ES6 transpile the "species pattern" for old browsers -


i reading species pattern

having following code

 class myarray1 extends array {     static [symbol.species]() {         return array;     } } 

we can make methods slice return instance of array.

so if validate (new myarray1).slice() instanceof myarray1 false.

all till now.

but if want transpile code, let's babeljs; far know not work older browsers not have new implementation of slice method states

let arrayspeciescreate(o, count).

if true, can not transpile new feature, question is:

are there other solutions(polyfills, etc)? or feature can not used on older browsers if transpile code?


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -