Java Script Values

Java script has two type of values:

  1. Fixed Value(Literals)
  2. Variable Value(Variables)
Java script.

Fixed Values(Literals):

Javascript literals or constants are the values which we generally assign to a variable.

Javascript literals can be represented in two types:

  1. A number can be represented with or without any decimal or floating points.

Let us see an example now which gives a further more clarity.

We have a number say 25.05 which is having a floating point..

So now according to the above reference we will get 25 only which doesn’t have any decimal point.

2. A string can or cannot be represented with double quotes.

Let’s now illustrate that scenario too

Say i have “Prequelcoding” and ‘Prequelcoding’ .

I get the same output which will be Prequelcoding which is a standard output as discussed from the above definition..

Variable Values(Variables):

A variable are generally containers to store data.

They are declared by the keyword “var

Now let us see an example.

var x = 12;

var y = 10;

var z = x*y;

Scroll to top