6
I am asking this because I was minificar a JS and he gave me a code that I did not understand very well...
My original code:
$('input').each(function(a,b){if(b.value == "U"){$('.variacao-sku').remove()}});
What he gave me:
$("input").each(function(a,e){"U"==e.value&&$(".variacao-sku").remove()});
The code worked until, but did not understand, he did not use if, checked if the string "U" is equal to e.value and used the operator && and removed the item with remove. What’s the meaning of that &&
there?
Wow, that’s very, very interesting. Thank you for that. (no irony)
– Máttheus Spoo