CodeBeginner

Function

Also known as JavaScript function

A callable piece of code that can receive inputs, perform work, and return a value.

In the real world

function double(n) { return n * 2; } returns 6 when called with double(3).

Related

Go a little deeper