ReadingNotes

Programming with JavaScript

Control Flow

The control flow is the order in which the computer executes statements in a script. The code is ran in order from the 1st line in the file to the very last line unless the computer runs acroos the structures that change the control flow, such as conditionals and loops. A normal script in JavaScript have many conrol structures and that includes conditionals, loops and functions. The parts of a script can also be set to execute when events occur. The control flow means that when you read a script, you have to read from start to finish but you also have look at the program structure and how it affects the order of execution.

JavaScript functions

A function in javascript is a block of code desinged to perform a specific task. The javascript function is executed when something call it.

Javascript Function Syntax

JavaScipt function is defined with the function keyword,followed, by a name followed by parentheses(). Javascript function names can letters,numbers,underscores,and dollar signs. Parentheses may also include parameter names seperated by commas. For example:(parametr1,para2,) The code is then exevuted by the function is placed in curly brackets:{} Function parameters are listend in () in the function defintion. Funct Agruements are values received by the function when its called.

Function INvocation

Code inside the function will execute when something invokes the function: When user clicks a button When its called from Javascript code Automatically.

Function return

When the JAvascript reaches a return statement, the function will stop executing. If the function was invoked from a statement, JavaScript will “return” to execute the code after the invoking statement.

Function used as variables

Fucntions can be used the same way as you use variables, in all types of formulas, assignments, and calculations.

Things i want learn more about

Do all function names have to include a number, letter, and dollar signs?