Data Types in Hindi

Typescript Data Types In Hindi – TypeScript in Hindi

TypeScript

Typescript Data Type In Hindi – Typescript Language Different Types Ki Values Ko Support Karti Hai. Yah Javascript Ke Liye Data Types Provide Karti Hai Jo Strongly-Typed Programing Language Me Transform Karne Ke Liye Hota Hai.

Yadi Aapne  HTML Full Course  And CSS Full Course And Python Full Course And PHP Full Course Nhi Read Kiya Hai To Aap Vah Bhi Read Kar Sakte Hai |

Typescript Data Types In Hindi

JS Data Types Ko Support Nahi Karti Hai, Lekin TS Ki Help Se Data Types Features Ko JS Me Use Kar Sakte Hai. Program Ko Use Karne Se Pahle Type System Given Values Ke Types Ko Check Karta Hai. Typescript Data Types Ko As An Optional Data Types Provide Karta Hai.

TypeScript Type

TS Static Types in Hindi

Static Types Ka Matlab “At Compile Time” Or “Without Running A Program” Hota Hai.Compiler Typechecking Ke Liye Inn Sabko Use Karta Hai.

Static Types Ko Aage Two Sub Categories Me Divide Kiya Gaya Hai.

TS Built-in or Primitive Type in Hindi

Typescript Me Five Built-In Data Types Hote Hai, Jo Ki Niche Diye Gaye Hai.

TypeScript Type

Number

JS Ki Tarah TS Me Bhi Saare Numbers Ko Floating-Point Values Ki Tarah Store Kiya Jata Hai. Numeric Values Ko Number Data Type Ki Tarah Store Kiya Jaata Hai.

Syntax:

let identifier: number = value;

Examples:

let first: number = 12.0;             // number   
let second: number = 0x37CF;          // hexadecimal  
let third: number = 0o377 ;           // octal  
let fourth: number = 0b111001;        // binary   
console.log(first);           // 123  
console.log(second);          // 14287  
console.log(third);           // 255  
console.log(fourth);          // 57  

String

Typescript Me Text Ko Represent Karne Ke Liye String Ko Use Kiya Jata Hai.Yah Textual Data Ke Sath Kaam Karti Hai. Ye Unicode Characters Ki Sequence Ko Bhi Represent Karti Hai.Yah Expression Ko Iss Form  $ {Expr} Me Embedd Bhi Karti Hai.

Also Read – TypeScript Vs JavaScript

Syntax:

let identifier: string = " ";  
                Or   
let identifier: string = ' ';  

Examples:

let empName: string = "Ajay";   
let empDept: string = "CSE";   
  
// Before-ES6  
let output1: string = employeeName + " works in the " + employeeDept + " department.";   
  
// After-ES6  
let output2: string = `${empName} works in the ${empDept} department.`;   
  
console.log(output1);//Ajay works in the CSE department.   
console.log(output2);//Ajay  works in the CSE department. 

Boolean

Static Or Numeric Data Type Me Multiple Type Ke Unlimited Number Ho Sakte Hai But Boolean Me Sirf Two Values Hi Store Kar Sakte Hai – True Or False.

Syntax:

let identifier: BooleanBoolean = Boolean value;

Examples:

let isDone: boolean = false;  

Void

Yah Ek Function Ki Return Type Hai Jo Kisi Bhi Type Ki Value Ko Return Nahi Karta.Jaha Par Koi Bhi Data Type Available Nahi Hota Vaha Par Iska Use Kiya Jata Hai.Yah Jyada Useful Nahi Hota Kyonki Hum Isme Null Or Undefined Ko Hi Assign Kar Sakte Hai. Undefined Data Type Uninitialized Values Ko Represent Karta Hai Null Uss Variable Ko Define Karta Hai Jiski Value Undefine Ho.

Syntax:

let unusable: void = undefined;  

Examples:

function helloUser(): void {  
  alert("This is a welcome message");  
}  
let tempNum: void = undefined;  
  tempNum = null;      
  tempNum = 123;      //Error

Null

Null usko represent karta hai jiski value undefined ho.Yah bhi void ki tarah jyada useful nahi hota.Null type ko define karne ke liye hum Null keyword ko use karte hai.Yah jyada useful isliye nahi hota kyunki hum isme null ko hi assign kar sakte hai.

Examples:

let num: number = null;  
let bool: boolean = null;   
let str: string = null; 

Undefined

JS and TS me Undefined data type uninitialized variables ko denote karta hai.Isme sirf ek value hoti hai vo hai – Undefined.

Also Read – Typescript Components

Examples:

let num: number = undefined;  
let bool: boolean = undefined;  
let str: string = undefined;

Any

Yah Saare Data Type Ka Super Data Type Hai.Hum Isme Kisi Bhi Type Ki Value Ko Assign Kar Sakte Hai.Yah Jab Jyada Useful Hota Hai Jab Hame Response Ya Data Ke Type Ka Nahi Pta Hota Ki Iska Type Kya Hoga Jaise Ki API Se Milne Wala Response.

Syntax:

let identifier: any = value;

Examples:

 let val: any = 'Hi';  
      val = 555;   // OK  
      val = true;   // OK 
function ProcessData(x: any, y: any) {  
  return x + y;  
}  
let result: any;  
result = ProcessData("Hello ", "Any!"); //Hello Any!  
result = ProcessData(2, 3); //5  	

Also Read – What Is TypeScript   

Leave a Reply

Your email address will not be published. Required fields are marked *