Search the Blog

Thursday, August 8, 2019

JavaScript Variables Code Syntax uses and Demo Example

Syntax for defining of variable-

1-String Type
      var   javascript_String_variable="Value what we want to assign ?";

2-Integer
      var    javascript_Integer_variable=3

3-Long
      var    javascript_long_variable= 123123123;
        // 64-bit number (from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)

4-Float
    var   javascript_float_variable= 10.6;
       // 32-bit floating-point number (decimal)

5-Double
    var javascript_double_variable= 9310141419482.22; // 64-bit floating-point number

6-Boolean
     var javascript_boolen_variable= true; // 1-bit true/false (0 or 1)

7-Boolean
     var javascript_boolen_variable= false;'

8-NAN
     var javascript_NAN_variable= NaN;

      var javascript_NAN_variable= 0/0; // NaN: Division by Zero is not possible

9- Not defined
      var javascript_notdefined_variable; // undefined: we didn't define it to anything ye

10- Null
      var javascript_null_variable= null;

No comments:

Post a Comment

Translate