Can I use property name of object as parameter? : <p>I want to make Favorite module in my app. I'm using React-native and Firestore. Here is my code:</p>

<pre><code>addFavorite() {
    getPlaceName().doc(this.selectedPlaceName.id).set({
        favorite: {
           uid : true
        }
    }, { merge: true }).then(() =&gt; {
        console.log('Added')
    }).catch((e) =&gt; {
        console.log('error', e)
    })
}
removeFavorite() {
    getPlaceName().doc(this.selectedPlaceName.id).set({
        favorite: {
            uid: false
        }
    }, { merge: true }).then(() =&gt; {
        console.log('Removed')
    }).catch((e) =&gt; {
        console.log('error', e)
    })
}
</code></pre>

<p>I store Favorite as a map in Firestore:</p>

<pre><code>favorite: {
    u001: true,
    u002: false}
</code></pre>

<p>So are there any ways to achieve it? Or do you guys have any other ideas how to get this favorite thing done?</p>
