Skip to content

DataOps Blog

Just another DataOps site

  • Home
  • certification
  • consultant
  • consulting
  • Contact Us!
  • courses
  • Intro to Laravel
  • tools
  • trainer
  • training

JAVA SCRIPT VARIABLE AND DATATYPE.

February 2, 2022
By Subham Kumar Mishra In JavaScript

JAVA SCRIPT VARIABLE AND DATATYPE.

What is Variable ?

Variable is just like a container which store the value into it .
ex- var x=6;
let y=x+z;

In above example x and y is a variable which store some value in it.
The variable is declare with var , let keyword.

In JavaScript we use var keyword for declaring the variable. var is use to specify the datatype of the value,It can hold any type of value such as numeric , string etc;

ex- var name =”Subham ,Karan, Musahid “; // in this variable we store string value inside name variable.
var Mob_no =1000100; //in this we store numeric value inside this variable.

Types of Variable.

There are two types of variables :-

1- Global variable

A global variable is declared outside the function or declared with window object. It can be accessed from any function.

EX:- global variable

<script>  
var value=50;    //global variable  
function a()
{  
alert(value);  
}  
function b()
{  
alert(value);  
}  
</script> 

2- Local variable

A JavaScript local variable is declared inside block or function. It is accessible within the function or block only.

EX:- Local variable

<script>  
function abc()
{  
var x=10;    //local variable  
}  
</script>

Datatype In JavaScript.

JavaScript provides two type of datatype for storing variable..

  1. Primitive Datatype
    1. String :- For storing sequence of the character.
    2. Number :- To represent numeric value in the variable.
    3. Boolean :- Store one value either true or false.
    4. Undefined :- Represent undefine variable.
    5. Null :- Store null value only.
  2. Non-Primitive Datatype
    1. Object :- Represents instance through which we can access members.
    2. Array :- Store collection of similar datatype.

Thanku

Written by:

Subham Kumar Mishra

View All Posts

Recent Posts

  • Kubernetes CKA Training Course & Official Master Certification Program
  • Elastic Training Course & Official Master Certification Program
  • Prometheus Training Course & Official Master Certification Program
  • AppDynamics Training Course & Official Master Certification Program
  • Dynatrace Training Course & Official Master Certification Program
  • Grafana Training Course & Official Master Certification Program
  • Newrelic Training Course & Official Master Certification Program
  • Splunk Training Course & Official Master Certification Program
  • Datadog Training Course & Official Master Certification Program
  • Zabbix Training Course & Official Master Certification Program
  • MLOps Training Course & Official Master Certification Program
  • DataOps Training Course & Official Master Certification Program
  • AiOps Training Course & Official Master Certification Program
  • Gitops Training Course & Official Master Certification Program
  • SRE Training Course & Official Master Certification Program
  • DevSecOps Training Course & Official Master Certification Program
  • DevOps Training Course & Official Master Certification Program
  • Best Blog website for Health and Fitness mymedicplus.com/blog
  • Top 5 Basic Programming Question for interview purpose in JS.
  • JAVA SCRIPT VARIABLE AND DATATYPE.

Archives

Categories

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
  • Free Video Tutorials
  • DevOps School
  • Best DevOps
  • scmGalaxy
  • Artificial Intelligence
  • DataOps
  • AIOps
  • GuruKul Galaxy
  • DevOps Consulting
  • DevOps Freelancers
  • DevOps Trainer
  • Free Ebooks
  • School for Debugger
  • Holiday Landmark
  • Surgery Planet
  • My Hospital Now
  • My Medic Plus
  • ProfessNow
  • Cotocus
  • Stocks Mantra
  • I Reviewed

Proudly powered by WordPress | Theme: BusiCare by SpiceThemes