Local and Global Variables | Computer Programming | Khan Academy

preview_player
Показать описание
Pamela explains the difference between "local" and "global" variables, a tricky concept in programming.

Computer Programming on Khan Academy: Learn how to program drawings, animations, and games using JavaScript & ProcessingJS, or learn how to create webpages with HTML & CSS. You can share whatever you create, explore what others have created and learn from each other!

For free. For everyone. Forever. #YouCanLearnAnything

Рекомендации по теме
Комментарии
Автор

Hello Khan Academy, When I started this video, The first thing I heard is "Now that you have mastered the basics of functions...". But on the Into to JS playlist, functions comes next after this video. How do I watch the videos in this playlist in the right order?

MerlinTempest
Автор

hello Khan academy, i am french, it's possible translate this video on your site in french please :)

Alex-gnjq
Автор

I feel like this idea is easy to understand and only made complicated by the strange decision making shown with variables. Global variables seem ideal for most cases, especially if the same trait will be factored into multiple functions. Local variables seem only useful for receiving information and returning an answer as well as formatting the usage of operations within a function.

sigurdtheblue