Is there a way to link the value of one object property to the value of another?

The idea is, that I have something like an excepted interface so I need the `propertys.name` and `.value` for my obj. In this special case name is easily constructed from value (value is an array and name is `array.toString()`)

I could use `obj.value.toString()` instead of value but the code needs to use `obj.name` to make it work for all cases.

I tried this code, but it does not produce the result I want. How could I achieve the desired behavior?

```
obj = {value: array, name: this.value.toString()}

```