Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax error in IE

Problem

I have a bit of code that keeps throwing an Syntax error but only in IE. I ran the code in JSLint but it didn't help me understand the issue.

JavaScript

 $('#sub').click(function() {
items = my_arr.filter(i => i.percent && i.unit);
     console.log(items);
})

IE 11 (Error)

SCRIPT1002: Syntax error
File: scripts.js, Line: 3346, Column: 26
like image 986
C. Kelly Avatar asked May 09 '26 00:05

C. Kelly


1 Answers

Check this ES6 Browser Compatibility table.

Arrow notation is ES6 feature and not supported by IE.

like image 65
hylimR Avatar answered May 11 '26 13:05

hylimR