reading-notes

reading notes for code fellows


Project maintained by dLeigh01 Hosted on GitHub Pages — Theme by mattgraham

Functions and Operators

Control Flow

the control flow is the order in which the computer executes statements in a script. Code runs in order from the first line to the last unless it hits something like a loop or a function call that changes the structure.

Javascript Functions

a function is a block of code designed to do a specific task, and it is executed when something invokes it.

Javascript Function Syntax

function NAME(parameters){ code here } is the way to write a function.

Function Invocation

return is the command to stop executing the function, and the code listed after return will become the return value, which is given back to the ‘caller’.

Why Functions?

you can define the code once and use it in many different spots with different results.

The () Operator Invokes the Function

the name of a function followed by parenthesis will return the result, while using no parenthesis will return the function object.

Functions Used as Variable Values

functions can be used in the same manner of variables in all the same situations.

Local Variables

variables declared within a function can only be accessed from within that function. Because of this, the same variable name can be used in multiple functions.

Javascript Operators

< table of contents

< home