let clicked = 0;
const tellEmHowItIs = (timesClicked = 0, mode = "buy") => {
if(mode.toLowerCase() === "buy"){
switch(timesClicked){
case 0:
alert("You gon need a backend for this homie.")
break;
case 1:
alert("Fine. We just magically charged your credit card $100000! >_>");
break;
case 2:
alert("Don't you have something better to do?");
break;
default:
alert("o_o;..........");
}
}
if(mode.toLowerCase() === "login"){
switch(timesClicked){
default:
alert("Come on, come this way. This is definitely not a bear trap.");
}
}};
document.getElementById("buy-button").addEventListener("click", () => {
tellEmHowItIs(clicked, "BUY");
clicked++;
})
document.getElementById("login-button").addEventListener("click", () => {
tellEmHowItIs();
})
Author: Keane Le
Have you ever seen a bear code? Probably not. I like to learn things about Software Development and IT. Let's learn together. Maybe you can teach me. Maybe I can teach you.
View all posts by Keane Le