On 08/29/2017 08:56 AM, Allen Wirfs-Brock wrote:
On Aug 28, 2017, at 12:29 PM, Sebastian Malton <[email protected]
<mailto:[email protected]>> wrote:
The outcome of this basically means "return from current context up
one level and then return from there”.
This would be a terrible violation of functional encapsulation. How
do you know that the (e.g.) forOf function isn’t internally using a
encapsulated helper function that is making the actual call to the
call back. You simply have no way to predict where returning from the
current context “up one” means.
I agree. I think this would be much better as
```js
function someThing(doWith) {
return doWith.map(elem => {
typeCheckLabel:
return elem * 2;
});
come from typeCheckLabel if (typeof elem !== "number");
return "Not all are numbers" ;
}
```
:-)
(I agree with the encapsulation argument.)
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss