---
title: "Comment by NITYAM on \"SDE-1(Web)/Frontend Engineer Interview Experience At ZestMoney\" | Hashnode"
description: "Hey Sai, I look into your solution for problem-solving. I have a doubt on 1st Ques you use Object.hasOwnProperty.call(result,key) for condition if ( Object .has"
url: "https://hashnode.com/posts/frontend-engineer-interview-experience-at-zestmoney/61fe9ffefd8b083e5728ccaf/comment/63380361fa20fa4bc8e56f6b"
---

[Discussion](https://hashnode.com/posts/frontend-engineer-interview-experience-at-zestmoney/61fe9ffefd8b083e5728ccaf)

Comment [SDE-1(Web)/Frontend Engineer Interview Experience At ZestMoney](https://hashnode.com/posts/frontend-engineer-interview-experience-at-zestmoney/61fe9ffefd8b083e5728ccaf)

[NITYAM](https://hashnode.com/@Nityam01)

[Oct 1, 2022](https://hashnode.com/posts/frontend-engineer-interview-experience-at-zestmoney/61fe9ffefd8b083e5728ccaf/comment/63380361fa20fa4bc8e56f6b)

Hey Sai, I look into your solution for problem-solving. I have a doubt

on 1st Ques you use Object.hasOwnProperty.call(result,key) for condition

```
if(Object.hasOwnProperty.call(result, key)){
                    result[key] = result[key] + obj[key]
                  }else{
                  result[key] = obj[key]
                } 
    }
```

but result.hasOwnProperty also work

```
if(result.hasOwnProperty(key)){
                    result[key] = result[key] + obj[key]
                  }else{
                  result[key] = obj[key]
                } 
    }
```

Is there any difference in using one then another

[Sriranga](https://hashnode.com/@sriranga)

[Oct 18, 2022](https://hashnode.com/posts/frontend-engineer-interview-experience-at-zestmoney/61fe9ffefd8b083e5728ccaf/comment/63380361fa20fa4bc8e56f6b#reply-634ee9f66d81329145457b9a)

oh, yeah, it's always safer to call using `Object.hasOwnProperty.call` cause the `result` object might not have a prototype when you create it and hence it might not even have the `hasOwnProperty` method in it. So when you use `Object.hasOwnProperty.call`, it looks into the prototype chain and borrows that function.
