Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

type of variable js

// get type of variable

var number = 1
var string = 'hello world'
var dict = {a: 1, b: 2, c: 3}

console.log(typeof number) // number
console.log(typeof string) // string
console.log(typeof dict)   // object
Comment

What are the types of variables and what are they in javascript?

Quas; What are the types of variables and what are they?
Ans; Here are the names of some type variables

// number type variable 
var myAge = 20;

// string type variable 
var myName = "iqbal";

// boolean type variable 
var amIsingle = true;
Comment

types of variables in javascript

There are two scopes of variables:

- Global variables - Defined anywhere in code
- Local variables - Defined in only function
Comment

PREVIOUS NEXT
Code Example
Javascript :: copy array 
Javascript :: how to check leap year in javascript 
Javascript :: break and continue in javascript 
Javascript :: js 1 second sleep 
Javascript :: convert milliseconds to dd/mm/yyyy javascript 
Javascript :: timezone using javascript 
Javascript :: or js 
Javascript :: how to generate random ip address in javascript 
Javascript :: js new function 
Javascript :: js DFS 
Javascript :: react how to get checkbox value on click 
Javascript :: jquery search string for substring 
Javascript :: prevent page scrolling when a modal is open 
Javascript :: yarn react 
Javascript :: JavaScript (rhino 1.7.9) sample 
Javascript :: createReadStream axios 
Javascript :: check for null 
Javascript :: print blade value in js 
Javascript :: javascript Create Objects: Constructor Function Vs Object Literal 
Javascript :: matrix calculator in js 
Javascript :: javascript Octal syntax is not allowed 
Javascript :: actionscript random randomfunction 
Javascript :: pizza form validation jquery 
Javascript :: Create & Download PDF from Byte[] Array using jQuery AJAX 
Javascript :: reactjs libphonenumber 
Javascript :: phaser export animation to json 
Javascript :: swr vs axios 
Javascript :: hook use effect with class 
Javascript :: how to target a hidden html element by js 
Javascript :: how to put multiple conditions in if statement node .js 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =