Re: Can we improve async JavaScript error handling?

2019-12-01 Thread Frederick Stark
We already have a construct that automatically returns a promise, which resolves on return and rejects on throw. It's called an async function! On Nov 30 2019, at 7:05 am, Lars Eidnes wrote: > Currently when awaiting calls there's some surprising behavior when combining > throw/catch and

Re: Re: What do you think about a C# 6 like nameof() expression for

2019-06-19 Thread Frederick Stark
You've already made this point, so you're not adding anything new to the discussion now. Especially since your point seems to be "I don't understand" and "it won't help me personally" It's time to take a step back and allow others to discuss. If a formal proposal eventuates, you can continue to

Re: Re: What do you think about a C# 6 like nameof() expression for

2019-06-16 Thread Frederick Stark
00))); > const y = 1; > > without having to already know the name of the identifiers, as is required by > the original proposal, which essentially negates itself as the string literal > ```'y'``` is briefer than ```nameof y```. > > > On Mon, Jun 17, 2019 at 4:19 AM Frederick

Re: Re: What do you think about a C# 6 like nameof() expression for

2019-06-16 Thread Frederick Stark
guest271314, your examples are all completely incorrect anyway since all variable declarations (including let and const) are hoisted to the top of the scope, so when nameof y is evaluated, y is already declared in the scope. The special behaviour introduced with let and const is that they set

Re: how many async-modules can js-app practically load?

2019-05-30 Thread Frederick Stark
Pretty sure your issue here is the multiple

Re: Destructuring for Array-like objects

2019-03-19 Thread Frederick Stark
This already works with an iterator, because array destructuring uses the iterator protocol const [a, b] = { 0: "ayy", 1: "bee", length: 2, *[Symbol.iterator]() { let i = 0; while (i < this.length) { yield this[i] i++ } }, }; On Mar 20 2019, at 11:59 am, Sultan wrote: > Afford array

Re: PSA: You can find existing proposals at https://github.com/tc39/proposals

2019-01-20 Thread Frederick Stark
There's also https://prop-tc39.now.sh/, which is much more readable. It generates it's content by scraping the GitHub pages, so should usually be up to date On Jan 20 2019, at 12:35 pm, Isiah Meadows wrote: > Not TC39, so don't read this as official communication. > > I've lately been seeing

Re: add reverse() method to strings

2018-03-18 Thread Frederick Stark
The point of a coding task for a beginner is to practice their problem solving skills to solve the task. This would remove the challenge and actively worsen their learning process On Mar 18 2018, at 6:26 pm, Grigory Hatsevich wrote: > > My use case is solving coding

Re: javascript vision thing

2017-12-17 Thread Frederick Stark
I appreciate hearing Kai's point of view and think that we've had this exact discussion enough times. At this point it just adds to inbox weight without changing any minds On Dec 18 2017, at 8:23 am, Terence M. Bandoian wrote: > I appreciate hearing Kai's point of view and

Re: How it feels to learn JavaScript in 2016

2017-10-27 Thread Frederick Stark
Best response I've seen: https://medium.freecodecamp.org/javascript-fatigue-fatigue-66ffb619f6ce I'd just like to thank TC39 for not breaking compatibility. All the niche old libraries I use that were written in ES5 still work in my ES6+ projects with no issues. The ability to take it or leave

Re: an operator for ignoring any exceptions

2017-08-01 Thread Frederick Stark
Having recently inherited a codebase which silently consumes errors in many places (using try/catch, Promises that don't reject - just stall, and promise.catch noops), I can imagine these getting used terribly. At least with the current operators, there's an expectation in the syntax that you