Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const satellite = 'The Moon';
- const galaxy = 'The Milky Way';
- let stars = 'North Star';
- const callMyNightSky = () => {
- stars = 'Sirius'; // scope pollution -- overwrites existing global value
- return 'Night Sky: ' + satellite + ', ' + stars + ', ' + galaxy;
- };
- console.log(callMyNightSky());
- console.log(stars);
Advertisement
Add Comment
Please, Sign In to add comment