A global variable is declared outside a function while a local variable is declared inside a function. The scope of that given variable 'local variable' will remain inside that function and it can not be used outside of that function.
N/B To be updated with more content
Top comments (2)
Hmm, explanation is okay, but try giving some more info, like:
Hence Global variables can be used any where in the code, but local variables can be accessed only in that particular function,
if you explain like this with more info, people can understand
I typed it in mobile, so if you find any typos, please ignore.
Can't wait for updates