Hello. Can such a small question. here is the method. Here comes promiss

onClick = () => getLogin({ permissions: 'premissions' }) .then(this.handleSuccess) .catch(this.handleError); 

but I need to call another method in this method and still return the promise. that is, I add an explicit return

 onClick = () => { this.handleClick('vk'); return getLogin({ permissions: 'premissions' }) .then(this.handleSuccess) .catch(this.handleError); }; 

How to replace?

    1 answer 1

    First of all, everything with an explicit return is normal. Secondly, if you really want to syntactically get rid of the word return (or this is done for debugging), you can put parentheses and a comma:

     var f = () => (console.log("f"), g()); function g() { console.log("g"); return 4; } console.log(f());