What is the difference between local and global variables?

Local variables are defined within a subroutine. Their scope/visibility ends when the cursor leaves the subroutine.
Global variables on the other hand are variables that exist outside of all the subroutines and functions, and are available to all of them.

CD
Answered by Chris D. Computing tutor

7699 Views

See similar Computing A Level tutors

Related Computing A Level answers

All answers ▸

Explain why it is important to check the email address with JavaScript and again when it reaches the server.


Choose 3 types of malware, describe them and the ways in which they may harm a device.


Why are bit patterns often displayed in hexadecimal notation instead of binary notation?


Describe the process of a binary search.


We're here to help

contact us iconContact ustelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2025

Terms & Conditions|Privacy Policy
Cookie Preferences