Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setLocation(city) {
- var country = "France";
- function printLocation() {
- console.log("You are in " + city + ", " + country);
- }
- return printLocation;
- }
- var currentLocation = setLocation ("Paris");
- currentLocation(); // output: You are in Paris, France
- //alert(currentLocation);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement