reading-notes

reading notes #7

  1. Control Flow: commands the sequence of statement execution in a program, including decision-making and the logical order of instructions. It encompasses conditionals (e.g., if, else, switch), loops (e.g., for, while), and function calls. By directing the execution order, you determine how your program reacts to different situations and inputs.

  2. JavaScript Function: a reusable code block with a specific purpose or set of tasks. Functions enable you to package a series of instructions into a single, organized, and manageable unit. They are created using the function keyword, a name, optional parameters, and a code block.

Example of a basic function:

function greet(name) { console.log(“Hello, “ + name + “!”); }

  1. Function Invocation (or Call): Calling a function means executing its code. To invoke a function, you use its name, provide any required arguments, and the function’s code runs, potentially returning a value or performing an action. Function invocation is accomplished by the function name followed by parentheses ().

  2. Parentheses in a function definition denote where parameters are declared, while in a function call, they are used to pass values to those parameters.

10/12