Proposal: Syntax sugar for single exit and early exit functions.

Garrett Smith dhtmlkitchen at gmail.com
Mon Nov 17 23:37:01 PST 2014


On 11/16/14, Biju <bijumaillist at gmail.com> wrote:

[...]

>
> Proposal:
> I wish there was some syntax sugar like
>
> function someClickHandler(){
>     doStuff();
>     doAnotherStuff();
>     doYetAnotherStuff();
> } finally {
>    return false;
> }
>

function rf() {
  try {
    throw-an-error;
  } finally {
    return false;
  }
}

rf(); // false
-- 
Garrett
@xkit
ChordCycles.com
garretts.github.io


More information about the es-discuss mailing list