0

Im doing a course in coding and I dont really get much help with my problem here. The Question is "Write a function called add7 that takes one number and returns that number + 7." Im a complete beginner and spend hundreds of hours reading articles and watching videos and whatnot and I still have my Issues with it, I dont quite know how to pull it off. My code so far:

    let userInput = prompt("Enter a Number! ");

add7 = () => {
    return userInput + 7;
}

alert(add7());

Its running on a local instance out of code studio, the html is a skeleton, its just about the JS. Why isnt that code working? It literally adds userInput and 7 together but doesnt do math on it. What do I need to do to make it work? And can someone help me understand some stuff behind it? It feels like Im missing something in regards to functions. Thank you in advance

0 Answers0