“string naskah” Kode Jawaban

Integer TypeScript

// There is no int type, use number
const myInt: number = 17;
const myDecimal: number = 17.5;
Arrogant Ape

array naskah

let list: number[] = [1, 2, 3];
Plain Panda

string naskah

let emplName:string =  "Mohit Jain";   
let compName:string = "geeksforgeeks";   
// Pre-ES6  
let emplDetail1: string = emplName + " works in the " + compName + " company.";   
// Post-ES6  
let emplDetail2: string = `${emplName} works in the ${compName} company.`;   
console.log("Before ES6: " +emplDetail1);  
console.log("After ES6: " +emplDetail2);
NidhiLive

string naskah

let emplName:string =  "Mohit Jain";   
let compName:string = "geeksforgeeks";   
// Pre-ES6  
let emplDetail1: string = emplName + " works in the " + compName + " company.";   
// Post-ES6  
let emplDetail2: string = `${emplName} works in the ${compName} company.`;   
console.log("Before ES6: " +emplDetail1);  
console.log("After ES6: " +emplDetail2);
NidhiLive

Jawaban yang mirip dengan “string naskah”

Pertanyaan yang mirip dengan “string naskah”

Lebih banyak jawaban terkait untuk “string naskah” di TypeScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya