-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlab5_exe_B.html
More file actions
26 lines (26 loc) · 911 Bytes
/
lab5_exe_B.html
File metadata and controls
26 lines (26 loc) · 911 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
26
<!DOCTYPE html>
<html lang =" en ">
<head>
<meta charset =" UTF -8">
<meta name =" viewport " content =" width = device - width , initial - scale =1.0">
<title> JavaScript String and Variable Exercise </title>
</head>
<body>
<script>
let firstName = "Jaisumer";
let lastName = "Sandhu";
let age = 20;
let fullName = firstName + " " + lastName;
console.log ( fullName );
let currentYear = new Date ().getFullYear();
let birthYear = currentYear - age;
console.log ( birthYear );
console.log ( fullName.length );
console.log ( fullName.toUpperCase () );
console.log ( `Hello, my name is ${fullName} and I am ${ age } years
old. I was born in ${ birthYear }.`);
let canVote = age > 18 ? true : false ;
console . log ( `I am eligible to vote : ${canVote}`) ;
</script>
</body>
</html>