A function imagimodel
It is time to really dive deep into functions. What are they, how do they work, and what makes them unique.
The primary responsibility of functions is to act as producers: they return new values. But there is a lot more to them than just their return statement. Let’s use an imagimodel to look at functions with perspective 👀.
The water in the ship represents the body of a function - stored code that can run when we execute. This is a way we can keep our code DRY and avoid writing the same code over and over again. We can write it once, store it in functions, and it’s there when we need it.
But how do we do that? How do these ships add water to the flow of our program? For that the JavaScript engine equips our ships with a special, terrifying power.
We can see her clearly at the front of the imagimodel - ready to be called upon when needed. Her name: The Invoker.




