0

i have 2 samples:

i have result undefined with this syntax using lambda:

  $.each($("ul"), () => {   
    console.log('lambda ' + $(this).attr("class") );
  });

its ok with this syntax using function():

  $.each($("ul"), function() {    
    console.log('function ' + $(this).attr("class") );
  });

I would understant why the results are differents. I'am thinking the syntax are equivalent. I am wrong?

Frenchy
  • 16,386
  • 3
  • 16
  • 39

0 Answers0