I'm a beginner in JavaScript. I'm reading the book JavaScript: The Good Parts. On page 35, it has the code:
...
walk_the_DOM(document.body, function (node) {
var actual = node.nodeType === 1 && node.getAttribute(att);
if (typeof actual === 'string' && (actual === value || typeof value !== 'string')) {
results.push(node);
}
});
I'm confuse about the value of the variable actual. Why is it a string type? Is it should be boolean type?