As per our lesson:
main()
function main(){
console.log("Hello World")
var x = 1
var y = 2
//console.log (x + " + " + y + " = " + add(x,y) + " my dude!!!")
console.log ("x is " + x + " before the add function")
add(x,y)
console.log ("x is " + x + " after the add function was called")
//console.log(`${x} + ${y} = ${add(x,y)} my dude!!!`)
}
function add(x, y) {
console.log("I am the add function. x is " + x + " right now. I'm about to change it to four")
x = 4
console.log("I am the add function. x is " + x + " and y is " + y)
return (x + y)
}
As per our lesson: main() function main(){ console.log("Hello World") var x = 1 var y = 2 //console.log (x + " + " + y + " = " + add(x,y) + " my dude!!!") console.log ("x is " + x + " before the add function") add(x,y) console.log ("x is " + x + " after the add function was called") //console.log(`${x} + ${y} = ${add(x,y)} my dude!!!`) } function add(x, y) { console.log("I am the add function. x is " + x + " right now. I'm about to change it to four") x = 4 console.log("I am the add function. x is " + x + " and y is " + y) return (x + y) }