?Briefly explain how to write JavaScript code.

What will be an ideal response?


?Keep the following syntax rules and guidelines in mind when writing JavaScript code. First, JavaScript is case sensitive, which means that it distinguishes between upper- and lower-case letters. If you create a variable named foodGroup, JavaScript will not recognize this variable if it is written as FoodGroup.Like HTML and CSS, you can incorporate comments in JavaScript code.Use two slashes for a one-line comment and use the slash and asterisk for multiline comments, as follows:// Single line comment syntax/* Multiple line comment syntax */?Using semicolons to end JavaScript statements is a common practice by programmers. Though it is not always necessary, it is a good best practice. The only time the semicolon is necessary is when multiple statements appear on the same line. The semicolon is used to separate each statement, similar to how a period separates one sentence from another. The following statements are all valid:foodOne = squashfoodTwo = pepper;foodOne = squash; foodTwo = pepper;?You can write JavaScript within an HTML page or as a separate JavaScript file with the filename extension .js. When JavaScript is written within an HTML page, the code may be within theheadelement or thebodyelement, depending upon the developer and the task at hand. The following is an example of how to write a JavaScript statement within an HTML document using the script tags.     JavaScript statement;?When you create JavaScript as an external .js file, place a script element in theheadelement of the HTML file and specify the external .js file as the file source, as follows:?

Computer Science & Information Technology

You might also like to view...

Answer the following statements true (T) or false (F)

1. To continue a JCL statement, you must code a nonblank character in position 72. 2. When a cataloged procedure is referenced on an OS/JCL EXEC statement, the operating system searches the procedure library and replaces the programmer’s EXEC statement with a set of pre-coded JCL. 3. The OS/JCL DD statement UNIT parameter specifies the physical input or output device. 4. DCB parameters are always coded in the program DCB. 5. To simplify retrieving cataloged or passed datasets, the programmer can give a file a unique name by coding a DSNAME (or DSN) parameter on the OS/JCL DD statement.

Computer Science & Information Technology

Which one of the following cryptographic algorithms supports the goal of nonrepudiation?

A. Blowfish B. DES C. AES D. RSA

Computer Science & Information Technology

Russ's computer has a 60 GB IDE hard drive that contains his operating system. He wants to add a second IDE hard drive to his computer. How should he configure the two drives?

a. Russ should configure the new drive as slave and the old drive as master. b. Russ should configure the new drive as master and set the old drive as slave. c. Russ should configure both drives as master. d. Russ should configure both drives as slaves.

Computer Science & Information Technology

Good programming practice requires that you end the last output display with a newline escape sequence, usually as the single character '\n'.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology