Skip to content

Commit

Permalink
Added Interview Question
Browse files Browse the repository at this point in the history
  • Loading branch information
malipramod committed Nov 5, 2019
1 parent 3709fdb commit b7c2266
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3391,7 +3391,32 @@ console.log(mul(2)(3)(4)(5)(6));
Answer: 1) 720
### 6. What would be the output of following code ?
```javascript
function getName1(){
console.log(this.name);
}

Object.prototype.getName2 = () =>{
console.log(this.name)
}

let personObj = {
name:"Tony",
print:getName1
}

personObj.print();
personObj.getName2();
```
1. undefined undefined
2. Tony undefined
3. undefined Tony
4. Tony Tony
Answer: 2) Tony undefined
Expand Down

0 comments on commit b7c2266

Please sign in to comment.