Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function welcome(name){
- var inner = " to "
- function innerF(location){
- let hi = "helo"
- let text = hi + " " + name + " " + "welcome" + inner + location
- return text
- }
- function sayHi(){
- return 'abc'
- }
- function setName(newName){
- inner = newName;
- }
- return {
- first: innerF,
- second: sayHi,
- third: setName
- }
- }
- var result = welcome('arpit')
- console.log('>>', result.first('ktm'))
- console.log('>>', result.third('hari'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement