My JS knowlage so far combined


#1

Here is my project I made:(My plans for the future is to make an app)
(It also doesn’t work, I runned it and it resulted in error)

console.log("(This is currently in beta!)")
console.log("What is your name?");
let Name = confirm("Ok is Alpha and cancel is Gray");
if (Name === true) {
  console.log("Your name is Alpha!");
  let Name = "Alpha";
} else {
  console.log("Your name is Gray!");
  let Name = "Gray";
}
let Answer = confirm("Do you want to know my favorite animal?");
if (Answer === true) {
  console.log("My favorite animal is an Axolotl");
  console.log("Here are some facts:")
  console.log("Axolotl's can regenerate its brain and many other parts");
} else {
  let Choice = confirm("Ok is facts and cancel is applications");
} if (Choice === true) {
  console.log("An integer is an whole number");
  console.log("Imagine your limb cuts off,");
  console.log("If you get another piece you can regrow it to perfect size");
} else {
  console.log("You picked applications,")
  let App = confirm("Ok is math test and cancel will stop this application");
} if (App === true) {
  console.log("WARNING:Losing will stop this application");
  let Q1 = confirm("Is 90 a valid integer?");
} if (Q1 === true) {
  console.log("Correct!");
  let Q2 = confirm("Is 10 divided by 1.2 equal to 5?");
} else {
  console.log("Sorry but you failed the test, better luck next time!");
} if (Q2 === true) {
  console.log("Sorry but you failed the test, better luck next time!");
} else {
  console.log("Nice skill!");
  console.log("That is it for today, hope you enjoyed this tiny app!")
}

Any feedback?


#3

Greetings :slight_smile:
If you are running the code in a browser, try using the alert() method to show info to the user instead of the console.log(). You might want to use the prompt() method to get the user’s input data.

Hope this helps you.


#4

thanks, appreciated that.