?Explain the syntax rules that must be maintained when writing JavaScript commands.

What will be an ideal response?

?Following are some syntax rules for writing a JavaScript command: The first important rule is to include semicolons at the end of each command. JavaScript is case sensitive, so make sure whether or not the letters of a JavaScript command are capitalized. For example, the command below improperly capitalizes the dialog box command as Window.Alert and, as a result, an error will occur when the script is run.Example of improper capitalization:Window.Alert("Welcome to Tulsa");Example of proper capitalization:window.alert("Welcome to Tulsa");Like HTML, JavaScript ignores occurrences of extra white space between commands, which makes it easier to read. However, unlike HTML, be careful about line breaks within commands. A line break placed within the name of a JavaScript command or within a quoted text string will cause an error when the script is run. Thus, the following code will cause the program to fail.Example of improper line break:window.alert("Welcometo Tulsa");If the user wants to break a text string into several lines, he/she can indicate that the text string continues on the next line by using the following backslash \ character.Example of proper line break:window.alert("Welcome \to Tulsa");To see how the browser will handle errors in the JavaScript code, modify thewindow.alert command, adding an intentional error using improper capitalization.
?

Computer Science & Information Technology

You might also like to view...

You can use the Macro ________ to edit a macro

A) Wizard B) Analyzer C) Designer D) Documenter

Computer Science & Information Technology

By default, method sorted uses ________.

a. ascending order b. the natural order for the stream's element type c. descending order d. the order specified in a command-line argument

Computer Science & Information Technology