I read in the D3 docs:
The specified listener is invoked in the same manner as other operator functions, being passed the current datum d and index i, with the this context as the current DOM element.
But when I run it like this:
d3.select('.bar')
.on('click', _toggleBar)
Then I see 3 arguments being passed to the _toggleBar
function:
function _toggleBar() {
console.log('arguments.length: ' + arguments.length);
console.log(arguments);
}
Where there is a datum object, index and third argument which is always zero.
Why does it happen and what's this third argument?