Reputation: 3075
I am sorting an Array with Javascript and it is working fine in Chrome, Firefox, Safari but in IE11 I am getting a syntax error. Anyone know what could be causing this? Here's my sort function:
arr.sort((a, b) => b - a);
Upvotes: 0
Views: 703
Reputation: 31863
Internet Explorer 11 does not support the ES2015 feature Arrow Functions.
Either use the function
syntax or incorporate a transpiler such as Babel or TypeScript into your toolchain.
Your code as transpiled by Babel
Your code as transpiled by TypeScript
Upvotes: 1