Friday, May 17, 2024
111
rated 0 times [  113] [ 2]  / answers: 1 / hits: 36947  / 8 Years ago, tue, july 26, 2016, 12:00:00

I get a error message in IE11 but not in chrome the error is:




Script1002 Syntax error




My code is as follows



var selectedRoles = vm.roles.filter(x => x.id === role.id);


The line and column number of the error suggest that it is the arrow function => that IE11 does not like. However it works fine in Chrome and Edge


More From » ecmascript-6

 Answers
23

ie 11 not support arrow functions



try



var selectedRoles = vm.roles.filter(function(x) { return x.id === role.id; });

[#61246] Saturday, July 23, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dahlias

Total Points: 730
Total Questions: 104
Total Answers: 101

Location: Denmark
Member since Tue, Jul 19, 2022
2 Years ago
;