In an existing application, I just felt on the following code:
function _repaint(elem) {
elem.style.display = 'none';
elem.offsetHeight; // jshint ignore:line
elem.style.display = '';
}
The second line seems completly useless to me, and I don't notice any changes to the app when removing it. Yet, it is voluntarily ignored for jshint
. So, I wonder what is its purpose?
Won't the JavaScript engine remove this useless line for optimization?