However programming is all about creating reusable codes, that can then be composed into more complex programs. Therefore you don't want to limit the usage of add to logging the result, instead you can achieve various tasks with it if you accept a callback: