Javascript multiple asignment re-evaluation or result passing?
问题 The multiple assignment (or is it called chaining ?) that I'm talking about is assignment such as: a = b = c = 2; ...after which a , b , and c are all equal to 2; My question of optimization is, given the following code: var dom1 = document.getElementById('layout_logos'); var dom2 = document.getElementById('layout_sitenav'); ... function layout_onscroll(){ ... dom1.style.height = dom2.style.top = maxLogoHeight - scrollTop; ... } From what I've been reading, I'm afraid the code in layout