Skip to content

Latest commit

 

History

History
17 lines (9 loc) · 1.01 KB

Read07.md

File metadata and controls

17 lines (9 loc) · 1.01 KB

All About JS Pt 2

Q1) What is control flow?

Control flow is the order in which code is executed. Code is executed from the first line to the last line, unless something in the code tells the interpreter to do something else. This occurs frequently when using conditionals, loops, and functions.

Q2) What is a JavaScript function?

A JavaScript function is a piece of code that represents instructions that are saved in memory in order to be reused later.

Q3) What does it mean to invoke - or call - a function?

To invoke (or call or execute) a function is to run the code that is inside the curly braces. This is done by listing the function name followed by parenthesis. If there are any parameters (see Q4) they will be placed inside of the parenthesis.

Q4) What are the parenthesis () for when you define a function?

When defining a function, the parenthesis () are used to hold your parameters. A parameter is the information that is the input of a function. Not all funtions have parameters.