Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. function welcome(name){
  2. var inner = " to "
  3. function innerF(location){
  4. let hi = "helo"
  5. let text = hi + " " + name + " " + "welcome" + inner + location
  6. return text
  7. }
  8. function sayHi(){
  9. return 'abc'
  10. }
  11. function setName(newName){
  12. inner = newName;
  13. }
  14. return {
  15. first: innerF,
  16. second: sayHi,
  17. third: setName
  18. }
  19.  
  20. }
  21. var result = welcome('arpit')
  22. console.log('>>', result.first('ktm'))
  23. console.log('>>', result.third('hari'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement