0
var myList = data.filter((v, i, a) => a.indexOf(v) === i);

This expression "=>" is not workingin IE. Can anyone please tell the alternative for this expression

  • there is none - use a transpiler to get it right – Jaromanda X Nov 16 '16 at 07:33
  • Fallback to normal functions. `data.filter(function(v, i, a) { return a.indexOf(v) === i; });` – Tushar Nov 16 '16 at 07:34
  • `data.filter(function(v,i,a){ return a.indexOf(v)===i })`. `=>` is a ES6 syntax that binds current context to callback. Since you are not using `this`, you can fallback to passing callback itself – Rajesh Nov 16 '16 at 07:34
  • 1
    @JaromandaX — If there is none, then a transpiler wouldn't be able to transpile it. – Quentin Nov 16 '16 at 07:34
  • @Quentin - I wont argue semantics. Of course there's an alternative, and in this case it's very simple. I would think anyone using arrow functions would already know about javascript functions and how they differ – Jaromanda X Nov 16 '16 at 07:35

0 Answers0