But testing for zero is a bit different:
nav.style.width = 0
console.log('Try: width===0: ' + (nav.style.width === 0) +
"; width==='0': " + (nav.style.width === '0') +
"; width==='0px': " + (nav.style.width === '0px'))
Output:
Try: width===0: false; width==='0': false; width==='0px': true