Advertisement
Guest User

Untitled

a guest
May 4th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. function setLocation(city) {
  2. var country = "France";
  3.  
  4. function printLocation() {
  5. console.log("You are in " + city + ", " + country);
  6. }
  7.  
  8. return printLocation;
  9. }
  10.  
  11. var currentLocation = setLocation ("Paris");
  12.  
  13. currentLocation(); // output: You are in Paris, France
  14.  
  15. //alert(currentLocation);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement