34,333
edits
Changes
no edit summary
<table border="0" cellspacing="0" width="100%">
<tr>
<td width="20%">[[Comments in JavaScript|Previous]]<td align="center">[[JavaScript Essentials|Table of Contents]]<td width="20%" align="right">[[Understanding JavaScript Functions|Next]]</td>
<tr>
<td width="20%">Comments in JavaScript<td align="center"><td width="20%" align="right">Understanding JavaScript Functions</td>
</table>
One of the most powerful features of JavaScript (and every other programming or scripting language for that matter) is the ability to build intelligence and logic into your web pages. It is vital in constructing scripts to be able to have the script make decisions and repeat tasks until specified criteria are met. For example, if you are developing an e-commerce application you may want to repeatedly ask a user to enter a credit card number until a valid credit card number is entered. Alternatively, you may want your script to loop a specifc number of times through a task before moving on to the next part of the script. All of this logic and flow control is achieved using some very simple structures. These are: