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
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.
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)
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.