Page 49 - 2611_SmartGPT Pro V(5.0) C-8
P. 49
Step 5 Click on the OK button in the message box.
The web browser displays the web page.
Which attribute is used to embed external JavaScript into HTML5 web
uiz Bee page?
_________________________________________________________________
STATEMENTS IN JAVASCRIPT
Commands and instructions given to the JavaScript interpreter to take some actions are called
statements and a collection of statements is called a script or a program. Within almost every
browser resides the JavaScript engine, which interprets and executes JavaScript code. We use
the semicolon to terminate a statement; however, if the statements are written in separate lines,
then the semicolon can be omitted.
JavaScript statements consist of keywords, variables, operators, expressions and comments.
Let us learn about them in detail.
KEYWORDS
A keyword is a reserved word that has a special meaning for the JavaScript interpreter. Some of
the keywords of JavaScript are:
var, switch, let, for, const, function, if, return, etc.
VARIABLES
A variable is the name of storage location. It stores a value that can be modified later. JavaScript
is a loosely typed language which means it does not require a data type to be declared before
using it. The syntax to declare a variable in JavaScript is:
var <variable name> = <value>;
where var is a keyword, <variable name> is a valid name for the variable and <value> is the value
that you want to assign to the variable.
For example:
var age = 16;
var name = "A"
Dynamic Web Pages in HTML5 47

