In this video I talk about global and local variables and where we can use each one. Now it’s up to you as a programmer to decide where to declare you JavaScript variables.
If you read this description then comment below:
“Just remember with great power comes great responsibility, I will decide wisely :p”
Don’t forget to subscribe:
http://www.youtube.com/user/QuentinWatt
For collaborations and business inquiries, please contact via Channel Pages: http://ChannelPages.com/QuentinWatt Social links:
————————————————————-
Add me on twitter:
Tweets by QuentinWatt
facebook group:
https://www.facebook.com/quentin.watt
————————————————————-
Original source
46 responses to “Javascript beginner tutorial 12 – variable scope”
Thank you for the videos. They've been extremely helpful. Keep up the good work.
thanks Quittin. I really enjoy your tutorials. message sent deep from the savannas of Africa.
!false
It's funny cause it's true
you did a fabulous job…
FUCK WIXXXXX
Thanks for making these amazing tutorials
A programmer is going to the grocery store and his wife tells him, "Buy a gallon of milk, and if there are eggs, buy a dozen." So the programmer goes, buys everything, and drives back to his house. Upon arrival, his wife angrily asks him, "Why did you get 13 gallons of milk?" The programmer says, "There were eggs!"
Lots of respect for you Quentin
Thanks!
Tashakkur, (uzbek) Raxmet,(kazakh) Sposibo,(russian) gracias (spanish), Teşekkür ederim (Turkish) ,Je vous remercie (French), dank je (dutch) and THANK YOU !
I hate fizz mains :((((((
Thanks a lot Mr Watt!
Many thanks.
I am unable to print a variable inside a function. I can print it outside but when I print it inside it doesn't show up.
good !
The very nice thing about your tutorials is that, going in normal pace and not overwhelmed all the knowledge in one video and the videos are sweet and short. Its very useful for beginners. amazing videos
Thanks for teaching us Quentin Watt.
uh? I thought if you put a var on it, then that makes it's own scope enabling it from being global.
lol
?
plz help mi
function noyon(){
var name="chhatni";//local variable
document.write( name + " Inside function <br>");
}
noyon();
document.write(name + "Outside function <br>");//never show this output beacuse it,s global variable
but problem when echo show result ====(chhatni Inside function <br>Outside function).
but Quentin Watt 12 number video print only ====(chhatni Inside function );
plz plz help
Quentin Watt but how is JavaScript used for web designing?
seriously, none of the videos, titled as "for beginners", are NOT for beginners except this tutorial. Thank you for explaining thoroughly.
Great video, as usual.
Given your expertise and your knack for making tutorials, I was wondering if you could crank out a video about pseudocoding.
I'd love that!
Thanx
If you have one function that gives a result, and you want to use that result in another function to get another result, what is the best way to do this? Do you make the result of function 1 a global variable so that it can be used in function 2 or do you nest?
Very helpful. Thanks
Hey, you play also League of Legends. My favorite hero is Akali. 🙂
Many thanks.
Thank you to Explain Each and everything in such a simple way…Can u Please add Js Patterns and Firebug Videos to it would be very helpful for us.
thanks Quentin your tutorials help me a lot thank you very much
u r the best tutor ….Hatsoff to you sir .I am very new new to this ,but I am understanding each and everything …U have a great Explanation skills .Thankyou so much for these videos .
Good Job, Boy
Wish the best for you. It is helpful
Hi! I use Firefox34.0.5 and global variable not function. I recive the value undefined.
"undefined inside function"
Hi Quentin, thanks so much for your helpful videos. I'm in Australia, just about finished my Diploma in a course which includes IT Skills. You have the best tutorials I've found so far, I'm actually enjoying Javascript now.
thanks quintin… ur videos are very much helpful
Jesus and Satan have an argument as to who is the better programmer. This goes on for a few hours until they come to an agreement to hold a contest with God as the judge. They set themselves before their computers and begin. They type furiously, lines of code streaming up the screen, for several hours straight.
Seconds before the end of the competition, a bolt of lightning strikes, taking out the electricity. Moments later, the power is restored, and God announces that the contest is over. He asks Satan to show his work. Visibly upset, Satan cries and says, “I have nothing. I lost it all when the power went out.”
“Very well,” says God, “let us see if Jesus has fared any better.”
Jesus presses a key, and the screen comes to life in vivid display, the voices of an angelic choir pour forth from the speakers.
Satan is astonished. He stutters, “B-b-but how?! I lost everything, yet Jesus’ program is intact! How did he do it?”
God chuckles, “Everybody knows… Jesus saves.”
["hip""hip"]
(hip hip array!)
Q: how many programmers does it take to change a light bulb?
A: none, that's hardware's problem!
Q: Why does programmers always mix up Halloween and Christmas?
A: Because Oct 31 == Dec 25
Subscribed! 🙂
really helpful for me
Nice video! it was very good explained!
thanks for tutorial. u teach well even though u have different accent but it is still understandable. i hope we can keep in touch.
superb tutorials!
Thanks for your tutorials.. 🙂
But one thing that I can't understand in this tutorial is: why we don't call the function and document.write() in the body? every time, we hold them in the head, and I don't know why!
Thanks again! 🙂
omg i hate fizz specially when i play karthus 🙁