dimanche 21 février 2021

Why does this javascript if statement have a comma operator? [duplicate]

I was looking at some code when I came across this:

if (m, y, d) {
document.getElementbyID('year').value = y;
document.getElementbyID('month').value = m;
document.getElementbyID('day').value = d;
console.log(m,y,d)
}

How does this statement work at all??

Aucun commentaire:

Enregistrer un commentaire