tracks

Codecademy

Sign in Sign up
22/71
JavaScript Quick Start Guide
Syntax

There are two ways of declaring a function in JavaScript, a function statement and function expression.

In some cases, you will want to use one over the other, so it's important to become familiar with both.

Take a look at each and try the example when you're ready.

Instructions
?
Stuck? Get a hint! Hint

For instance, if you wanted to make a function called 'baz', you could write:

function baz() { };

or

var baz = function() { };

script.js
Back to Editor

Sign in