Coding

JavaScript Literals – JavaScript Tutorial

Task

What is JavaScript Literals

Description

JavaScript statements are composed of: Values, Operators, Expressions, Keywords, and Comments.
JavaScript Values
The JavaScript syntax defines two types of values: Fixed values and variable values.

Fixed values are called “Literals”.
Variable values are called “Variables”.

JavaScript Literals
The most important rules for the writing fixed values are:
Numbers are written with or without decimals:

Example

<p id="demo"></p>
 
<script>
document.getElementById("demo").innerHTML = 10.50;
</script>
Try It Yourself - Online Compliler >>