-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
36 lines (32 loc) · 814 Bytes
/
index.js
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
// Calculator Program
const display = document.getElementById("display");
function appendToDisplay(input){
display.value += input;
}
function clearDisplay(){
display.value = "";
}
function calculate(){
/* start easter eggs */
if((display.value == '80085')||(display.value == '8008135')){
display.value = "( * ) ( * )"
}
else if(display.value == '8008'){
display.value = "Josh Peck";
}
else if(display.value == '404'){
display.value = "error tyshi";
}
else if(display.value == '361/)/4/26'){
display.value = "Edward :)";
}
else{
/* end easter eggs */
try{ /* error catcher */
display.value = eval(display.value);
}
catch(error){
display.value = "prolly like 2";
}
}
}