-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathexample01.html
30 lines (29 loc) · 968 Bytes
/
example01.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The startsWith(), includes(), and endsWith() methods</title>
<style>
body {
margin: 1em;
font-size: 1.5em;
}
div {
margin-top: .5em;
}
</style>
</head>
<body>
<div id="output">
</div>
<script>
const bookName = "HTML, CSS, and JavaScript For Dummies";
console.log(bookName.startsWith("HTML")); // Returns true
console.log(bookName.startsWith("CSS", 6)); // Returns true
console.log(bookName.includes("JavaScript")); // Returns true
console.log(bookName.includes("for")); // Returns false
console.log(bookName.endsWith("Dummies")); // Returns true
console.log(bookName.endsWith("JavaScript", 25)); // Returns true
</script>
</body>
</html>