javascript variable scopes code example Example: scope in js // the scope is by default global var name = 'Hammad';