See, thats more like it.
If you’ve absorbed the idea of what the divisor/modulo operator does, you can generate your own answer to the coding challenge, which is what it’s designed to do.
To go back to your original post of not understanding a line like this:
We need to go back to the original source of the code.
var numyears = Math.floor(seconds / 31536000);
var numdays = Math.floor((seconds % 31536000) / 86400);
var numhours = Math.floor(((seconds % 31536000) % 86400) / 3600);
var numminutes = Math.floor((((seconds % 31536000) % 86400) % 3600) / 60);
var numseconds = (((seconds % 31536000) % 86400) % 3600) % 60;
return numyears + " years " + numdays + " days " + numhours + " hours " + numminutes + " minutes " + numseconds + " seconds";
Note that this code was originally developed to look for the number of YEARS first (which is where 31536000 comes from - number of seconds in a year), and was not bound by constraints such as “it will be less than 100 hours”.
Archibald is correct in that the later lines can be simplified - but only because every larger value’s modulo is a multiple of the smaller one.
X % 3600 % 60 is redundant; 3600 is a multiple of 60, so you can just say X % 60 and get the answer immediately.