title: Is it possible to return a setter in function call in javascript?
body: <pre><code>class Person{
    set name(value){
      this._name = value;
    }
    get name(){
      return this._name;
    }
  
    modify(){
      return this.name;
    }
  
  }
  
  
  const adam = new Person();
  adam.name = 'Adam'; //assign new value to setter :)
  adam.modify() = 'Adam'; //assign new value to getter :(
  </code></pre>
  <p>I wonder if it is possible to return a setter in the called function like in the example above. The example does not work because the <code>adam.modify</code> called function returns <code>getter</code> (it calls <code>this.name</code> <code>getter</code> method) so the new value <code>'Adam'</code> is in fact assigned to the returned primitive value <code>undefined</code> as I guess and not to the the <code>adam._name</code> property.</p>
  <p>What I want to do is to make the example from above work, that is <code>adam.modify() = 'Adam';</code> should assing new value to <code>adam._name</code>. Is it possible in any way?</p>
  <p>I'm writing my own private framework and I wish it would look like this, eg. <code>$cell('C22') = 100;</code>
  The only way I have figured it out so far is to make it that way <code>$cell('C22').value = 1000;</code> but I wish the function could return the setter itself.</p>