I was parsing some smooth-scrolling code online (at https://css-tricks.com/snippets/jquery/smooth-scrolling/) and found the line if (target.length) {some stuff}. Doesn't the .length operator return an integer? How does this work with the if() statement, as I thought they take only true/false values? The same target.length was used as the condition for a ternary statement slightly earlier in the code.