I'm trying to figure out how some javascript code for creating pagination is working and I ran across this line:
if (+a[i].innerHTML === Pagination.page) a[i].className = 'current';
I was just wondering what the + is doing in this +a[i]. Here is the rest of that section of code just in case.
Bind: function() {
var a = Pagination.e.getElementsByTagName('a');
for (var i = 0; i < a.length; i++) {
if (+a[i].innerHTML === Pagination.page) a[i].className = 'current';
a[i].addEventListener('click', Pagination.Click, false);
}
},