-
Notifications
You must be signed in to change notification settings - Fork 0
/
string.html
50 lines (43 loc) · 1.06 KB
/
string.html
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<style></style>
</head>
<body>
<h1>String</h1>
</body>
<script type="text/javascript">
function print(firstname) {
console.log('hello ' + firstname);
}
print('Ravikumar');
/*
In es6 easy to define sting using a ` tag
you can easy to break line also
*/
function print1(firstname) {
console.log(`Hello ${firstname}`);
}
print1('Ravikumar');
/*easy to break a line*/
function createEmail(firstname, price) {
let shipping = 5.95;
console.log(`Hi ${firstname}! thanks!
Total : ${price}
Shipping : ${shipping}
`);
}
createEmail('Guy', 100);
/*easy to break a line*/
function createEmail1(firstname, price) {
let shipping = 5.95;
console.log(`Hi ${firstname}! thanks!
Total : $${price}
Shipping : $${shipping}
Grand total : $${price + shipping}
`);
}
createEmail1('Luice', 100);
</script>
</html>