I am trying upgrade my javascript programming skills ( or lets say my programming skills period : ) )
so I am trying to understand some semantics :
in the first line what does the "?" mean as well as the minus sign in "-distance"
in the second line what does '+=' or '-=" mean?
el.css(ref, motion == 'pos' ? -distance : distance)
animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
thank you
el.css(ref, -1 * ('pos' === motion) * distance), :P (just a joke)(1-('pos'===motion)*2)*distance.