Super function

# Michael J. Ryan (9 months ago)

What might be better is to extend break for named functions.

function someFn(arr) {
  return arr.map(e => {
    if(...) {
      break someFn return "...";
    }
    return e * 2;
  });
}

This way you know what you're breaking from.. super would imply one level deep.. break already has some similar constructs. In this case it must be a named function or named variable assigned a function. Not a reserved word (break while, break for, etc already works)

# Sebastian Malton (9 months ago)

An HTML attachment was scrubbed... URL: esdiscuss/attachments/20170828/c02944e7/attachment

# Isiah Meadows (9 months ago)

Note: Kotlin has this 1, but it imposes numerous restrictions on its usage. There's no way you could accomplish this without either that, pseudo-exceptions, or both.


Isiah Meadows me at isiahmeadows.com

Looking for web consulting? Or a new website? Send me an email and we can get started. www.isiahmeadows.com