Skip to content

Commit a19f749

Browse files
committed
New: Simple string format with variables example.
1 parent ad555ab commit a19f749

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

basic/string.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,9 @@ let text2 = "How are you doing today?";
5050
const myArray = text2.split(" ");
5151
let word = myArray[1];
5252
console.log(word);
53+
54+
// string format with variables
55+
var my_name = 'John';
56+
var s = `hello ${my_name}, how are you doing`;
57+
console.log(s); // prints hello John, how are you doing
58+

0 commit comments

Comments
 (0)