Javascript Functions

This is how we write and call a function in Javascript. You can copy paste this directly into the Javascript console:

function APPhelloWorld(Input){ return "Hello " + Input; } var Result = APPhelloWorld("World"); console.log(Result);

You should see something like this:

We can assign Javascript functions into variables like this:

 

var X = APPhelloWorld; X("Fred");

Â