Sign in
Log inSign up

Please explain below code

Rahul Bisht's photo
Rahul Bisht
·Aug 23, 2017

I found below line from somewhere. How does it work?

!g.handledFrom && g.from < c.index + e.length && g.from >= c.index && (a.push({      type: "start",      offset: g.from - c.index,      marker: g    }),    g.handledFrom = !0);

complete method

 function(a, b, c, d, e) {  a = [];  if (b) {  d = 0;  for (var f = b.length; d < f; d++) {  var g = b[d];  !g.handledFrom && g.from < c.index + e.length && g.from >= c.index && (a.push({  type: "start",  offset: g.from - c.index,  marker: g                 }),  g.handledFrom = !0);  !g.handledTo && [g.to](g.to) <= c.index + e.length && [g.to](http://g.to/) >= c.index && (g.handledFrom || (a.push({  type: "start",  offset: g.from - c.index,  marker: g                 }),  g.handledFrom = !0),  a.push({  type: "end",  offset: [g.to](g.to) - c.index,  marker: g                 }),  g.handledTo = !0)             }         }   return a     }