-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
46 lines (44 loc) · 1.12 KB
/
script.js
File metadata and controls
46 lines (44 loc) · 1.12 KB
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
function generate(){
TextInput = document.getElementById("TextInput").value;
if (document.getElementById("fnum").value === undefined){
fnum = 0;
}else{
fnum = document.getElementById("fnum").value;
}
let i=0;
input = TextInput;
let string = "";
let a=1;
let b=1;
let c=0;
while(i < input){
c=a+b;
if(i<input && c>=fnum){
string = string + c+' ';
}
b=c+a;
i++;
if(i<input && b>=fnum){
string = string + b+' ';
}
i++;
a=b+c;
if(i<input && a>=fnum){
string = string + a+' ';
}
i++;
}
console.log(string);
document.getElementById('fibo').innerHTML = string;
}
// document.write(string);
//function gen2(){
// Input = TextInput;
// document.getElementById('fibo').innerHTML = generate(Input);
//}
importScripts('https://storage.googleapis.com/workbox-cdn/releases/6.4.1/workbox-sw.js');
// This will work!
workbox.routing.registerRoute(
({request}) => request.destination === 'image',
new workbox.strategies.CacheFirst()
);