I had recently begun learning and implementing objects in JavaScript. But it made me think, if the functionality of an object can be put into one method, then why use multiple methods like Example.prototype.update = function()
with Example.prototype.draw = function()
if one of these methods were to not require arguments? I could just define and then call on one method like Example.prototype.do = function()
and put all of the functionality the two methods had. It's easier and less code, but maybe it's better to have a structure in my object with several, specific methods? Thank you.
EDIT: I ask this about methods without parameters because if you grouped all of the functionality of several methods with parameters it would be too much tedious work inputting a dozen arguments into one function.
Thanks for downvoting!