Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
150
rated 0 times [  151] [ 1]  / answers: 1 / hits: 16881  / 8 Years ago, thu, april 14, 2016, 12:00:00

Array.from is an ES6 feature. When I use it in TypeScript and compile to ES5 target it does not change it:



tsc -t es5 prog.ts


i.e. when I look inside prog.js I still see Array.from in the same place. Using prog.js in IE11 complains as follows:




Object doesn't support property or method 'from'




Why doesn't TypeScript convert Array.from in to some ES5 alternative?



Is there a way to set it up so it does?


More From » typescript

 Answers
47

It is a method that can be polyfilled.



Language features that can't be polyfilled are transpiled (if possible on the selected TypeScript target).


[#62558] Tuesday, April 12, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tyriquehenryq

Total Points: 248
Total Questions: 81
Total Answers: 105

Location: Bermuda
Member since Thu, Apr 20, 2023
1 Year ago
;