0% found this document useful (0 votes)
13 views2 pages

JavaScript Syntax Is The Set of

JavaScript syntax outlines the rules for constructing programs, including variable creation and usage. It distinguishes between fixed values, known as literals, and variable values. Key syntax rules include the representation of numbers and strings, which can be enclosed in quotes.

Uploaded by

Dacara Rhegine G
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

JavaScript Syntax Is The Set of

JavaScript syntax outlines the rules for constructing programs, including variable creation and usage. It distinguishes between fixed values, known as literals, and variable values. Key syntax rules include the representation of numbers and strings, which can be enclosed in quotes.

Uploaded by

Dacara Rhegine G
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

JavaScript syntax is the set of rules, how JavaScript programs are

constructed:

// How to create variables:


var x;
let y;

// How to use variables:


x = 5;
y = 6;
let z = x + y;

JavaScript Values
The JavaScript syntax defines two types of values:

 Fixed values
 Variable values

Fixed values are called Literals.

Variable values are called Variables.

JavaScript Literals
The two most important syntax rules for fixed values are:

1. Numbers are written with or without decimals:

10.50

1001

2. Strings are text, written within double or single quotes:

"John Doe"

'John Doe'
<!DOCTYPE html>
<html>
<body>

<h2>JavaScript Strings</h2>

<p>Strings can be written with double or single quotes.</p>

<p id="demo"></p>

<script>
[Link]("demo").innerHTML = 'John Doe';
</script>

</body>
</html>

You might also like