-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
31 lines (27 loc) · 865 Bytes
/
index.js
File metadata and controls
31 lines (27 loc) · 865 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
27
28
29
30
31
const word = `goodbye`;
const word2 = `nice try`;
const word3 = `trust`;
const word4 = `mistake`;
const word5 = `hearts`;
function showWord(data, start, end) {
let result = data.substr(start, end);
console.log(result);
return result;
}
showWord(word, 0, 4);
showWord(word2, 0, 4);
showWord(word3, 2, 2);
showWord(word4, 3, 7);
showWord(word5, 2, 3);
const output = showWord(word, 0, 4);
const output2 = showWord(word2, 0, 4);
const output3 = showWord(word3, 2, 2);
const output4 = showWord(word4, 3, 7);
const output5 = showWord(word5, 2, 3);
function generate() {
document.getElementById("output").innerHTML = output;
document.getElementById("output2").innerHTML = output2;
document.getElementById("output3").innerHTML = output3;
document.getElementById("output4").innerHTML = output4;
document.getElementById("output5").innerHTML = output5;
}