forked from luben-gonsalves/JavaScript-for-Everyone
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path04-string_interpolation.js
More file actions
28 lines (23 loc) · 818 Bytes
/
04-string_interpolation.js
File metadata and controls
28 lines (23 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
let firstName = "Asabeneh";
let letlastName = "Yetayeh";
var age = 200; // number data type
var country = "Finland";
var job = 'teacher';
let lang = 'JavaScript'
var personInfo = `I am ${fullName}.I am a ${age} years old. I am a ${job} and I love teaching.
I live in ${country}.`; //ES6 - String interpolation method
console.log(personInfo);
let numberOne = 10;
let numberTwo = 90;
console.log(`The sum of ${numberOne} and ${numberTwo} is ${numberOne + numberTwo}.`);
//More Examples
var gravity = 9.81;
var boilingPoint = 100;
var bodyTemp = 37;
/*
The boiling point of water is 100 oC.
Human body temperatue is 37 oC.
The gravity of earth is 9.81 m/s2.
*/
console.log(`The boiling point of water is ${boilingPoint} oC.\nHuman body temperatue is ${body} oC.\nThe gravity of earth is ${gravity} m / s2.`
);