DECISION MAKING
There are often several places in a script where decisions are made that determine which lines of code should be run next. Flowcharts can help you plan for these occasions.
In a flowchart, the diamond shape represents a point where a decision must be made and the code can take one of two different paths. Each path is made up of a different set of tasks, which means you have to write different code for each situation.
In order to determine which path to take, you set a condition. For example, you can check that one value is equal to another, ...
Get JavaScript and JQuery: Interactive Front-End Web Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.