Thinking Like a Function Part 1: What's a function? As a software engineer, you probably think of a function as a unit of code that takes some arguments and returns some value, eg: function square(x) { return x * x; }