“JavaScript interpolasi string” Kode Jawaban

JavaScript interpolasi string

const age = 3
console.log(`I'm ${age} years old!`)
Drab Dogfish

String literal javascript

`string text`

`string text line 1
 string text line 2`

`string text ${expression} string text`

tag`string text ${expression} string text`
Happy Heron

interpolasi string JS

const apples = 4;
const bananas = 3;
console.log(`I have ${apples} apples`);
console.log(`I have ${apples + bananas} fruit`);
Puzzled Puffin

interpolasi string JS

var name = "Taimoor";
var country = "Pakistan";

// string interpolation
console.log(`I am ${name} and I am from ${country}`);
Distinct Dolphin

Format string JavaScript

const string = 'This is a string.';
const message = `${string} This is also a string.`;
elyiscool

Interpolasi di JS

const name = "John";

console.log(`Welcome ${name}.
You have ${2 * 5} new notifications!`);
Toutou Toutou

Jawaban yang mirip dengan “JavaScript interpolasi string”

Pertanyaan yang mirip dengan “JavaScript interpolasi string”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya