DEV Community

Discussion on: Know the difference between theses JS concept in order to skill up #1

aarone4 profile image
Aaron Reese

Sort of. You should declare it globally BECAUSE you intend to modify it within a localised scope. This is how the js frameworks work. Vue is effectively a Global object which can have it's properties manipulated by the functions within it. but then we are getting into immutability and state management.