Quick Index
Overview


Note that we'll use the terms method and function interchangeably here because of their similiarty in this context.

The "Big Three" of a method:


The big three is a general concept -- not specific to a given programming language.

Examples


With Java, just the method header tells us this method returns a String type, is named "go", and receives two parameters (of type "int" and "double").

So we only need a method header to know how to send a message.
public String go(int level, double factor)
Just like the Java example, a JavaScript method has has the big three.

In JavaScript, we can immediately see the name of the method and method params.

The method description (notes) should tell us about the return value and type and method param types.
go(level, factor)
A JavaScript function closely resembles a JavaScript method. The only difference is the keyword "function" is required.

It also has the big three.
function go(level, factor)


Navigation