My Quote Machine functions

My Quote Machine functions
0.0 0

#1

Hello guys, I’ve been working on my quote machine for 2 days, and I thought that I would finish it soon after managing to the quote button, but after trying a variable from a function to another function to make another button work, it made me stuck and now I have no idea what can I do since I’m still new with javascript.

I want to know how can I make the var b from function 1 to work in function 2.

Here’s my copdepen : https://codepen.io/jvincent3/pen/EWVEeZ


#2

What you’ll want to do is call function2 inside of function1 and pass the variable as a parameter.

function1() {
    var someVar = "Hello";
    function2(someVar);
}

function2(word) {
    console.log(word + ", world!");
}

#3

Thanks a lot, but I fixed it already, I got help from FCC discord.

I don’t know how to close the thread.