Javascript beginner tutorial 12 – variable scope




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:

facebook group:
https://www.facebook.com/quentin.watt
————————————————————-

Original source


46 responses to “Javascript beginner tutorial 12 – variable scope”

  1. 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!"

  2. 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

  3. 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

  4. 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?

  5. 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 .

  6. 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.

  7. 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.”

  8. 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! 🙂 

Leave a Reply