Reputation: 3525
x = 10
function lol(){
x = 5
}
function rofl(){
alert(x)
}
In the rofl()
function, how can i make the alert popup number 5
? help me please I'm so noob trying to figure this out for 4 hours now :S
Upvotes: 0
Views: 123
Reputation: 28625
You dont have to do anything other than call the functions. You have set them up properly, but if you dont call them then nothing will happen.
x = 10
lol();
rofl();
function lol(){
x = 5
}
function rofl(){
alert(x)
}
Upvotes: 0
Reputation: 359786
You're close. Really, really close.
The only problem is that you're not actually invoking either of the functions. This is all you're missing:1
lol();
rofl();
Working demo: http://jsfiddle.net/mattball/VsGWe
1 Well, that and some semicolons.
Upvotes: 4