I have this function:
$(".tabstrip li").each(function () {
$(this).attr("id") == "searchlist" ? $(this).addClass("selected") : $(this).removeClass("selected");
})
Now i was asking myself, if I can make this shorter. So I tried this:
$(".tabstrip li").each(() => $(this).attr("id") == "searchlist" ? $(this).addClass("selected") : $(this).removeClass("selected"))
And it don't worked. How I understood arrow functions this should be correct.
(There is no error too)
Do someone understand this? Its not important but I cant sleep until i figure out why this don't work ;)
Thank you for your time ^^