That'll work too!

If you're interested in micro-optimization, I think that in v8 adding intervalID here will be slightly faster, as adding a new key to an object will result in a new hidden class being created (see https://developers.google.com/v8/design)

But at the end of the day, I highly doubt you'll see an impact from that in this application.