Page 384 - Webapplication11_C11_Flipbook
P. 384

document.write(i + "<br>");
                  }

                  </SCRIPT>
                  </BODY>
                  </HTML>
              On running the above program, we get the following output:

























                   Recap Zone

                 Ð Ð JavaScript is an interpreted computer programming language that was first implemented as part of a web browser.
                 Ð Ð JavaScript closely interlinked with HTML code, yet it’s handled by the browser’s JavaScript interpreter.
                 Ð Ð JavaScript has excellent options for making a website more interactive and user-friendly.
                 Ð Ð JavaScript is frequently utilised to accomplish tasks that would otherwise slow down the server.
                 Ð Ð A complete web page can be visualized as three separate layers—content, presentation and behaviour.
                 Ð Ð JavaScript is typically embedded into an HTML document using the <script> tag.
                 Ð Ð The write() method writes straight to an open (HTML) document stream.
                 Ð Ð Variables in JavaScript can hold a variety of data types, including numbers, strings, objects, and more.
                 Ð Ð A JavaScript variable (also known as an identifier) is a storage location in the memory.
                 Ð Ð A constant is a type of variable whose value cannot be modified while the program is running.
                 Ð Ð The typeof is a type checking operator in JavaScript that returns the data type of the operand passed to it.
                 Ð Ð Operator precedence and associative rules play a factor when an expression comprises a large number of operators and
                    operands and the sequence of evaluations is uncertain.

                 Ð Ð When an expression is evaluated and two different types are given that are incompatible to perform the operation,
                    JavaScript automatically converts them.
                 Ð Ð When a user enters inaccurate information, the developer will utilise an alert box to show the user a warning or error.
                 Ð Ð The prompt( ) method asks the user to enter a value. It has two buttons, one for ‘Ok’ and one for ‘Cancel’.
                 Ð Ð The confirm( ) method is used to obtain confirmation from the user about an action.
                 Ð Ð A block is a collection of statements that are joined together with braces to form a single statement.
                 Ð Ð If and else support conditional statements in JavaScript.
                 Ð Ð The switch statement is used to pick one of many code blocks to be performed.
                 Ð Ð Loops come in a variety of shapes and sizes, but they all perform the same thing: they repeat a task a certain number of
                    times.
                 Ð Ð An infinite loop is a piece of code that never ends because it never reaches the ending condition.

                382     Touchpad Web Applications-XI
   379   380   381   382   383   384   385   386   387   388   389