pretty succinct with existing de-structuring syntax:
```
const [variable = defaultValue] = [maybeUndefinedValue]
const fn = ({ key = defaultValue }) => { console.log(key); }
```
> On 11 Jan 2019, at 12:00, es-discuss-requ...@mozilla.org wrote:
>
> Send es-discuss mailing list submissions to
>
>const [variable = defaultValue] = [maybeUndefinedValue]
This would fail throw for variables you don't know exist i.e in the
following example polyfill will throw if Symbol doesn't exist.
const [Symbol = SymbolPolyfill] = [Symbol]
This is specifically why convention is to use:
typeof maybeUnd
(Hi all, new to group)
Some of the Well Known Symbols are linked to standard functions -
Symbol.toStringTag - A string value used for the default description of an
object. Used by Object.prototype.toString().
When I have a Class instance (say, `const flow = new Flow()`, the debugger
shows `fl
Let's restrict custom `typeof` values to just symbols - objects are
unnecessarily weighty, strings would break a lot of code, and other
primitives are generally useless.
A property sounds compelling, and I feel like I saw it suggested a while
back (forget where) something similar by a TC39 person.
I'd just prefer a way to detect the value `undefined` vs no such binding.
On Sat, Jan 12, 2019 at 10:26 Sultan wrote:
> >const [variable = defaultValue] = [maybeUndefinedValue]
>
> This would fail throw for variables you don't know exist i.e in the
> following example polyfill will throw if Symb
Yeah I guess there exists a use case for that method still. But I don’t feel
that use case merits special syntax.
> On 12 Jan 2019, at 16:25, Isiah Meadows wrote:
>
> I'd just prefer a way to detect the value `undefined` vs no such binding.
>> On Sat, Jan 12, 2019 at 10:26 Sultan wrote:
>> >co
a common use-case i have is counting newlines in largish (> 200kb) embedded-js
files, like this real-world example [1]. ultimately meant for
line-number-preservation purposes in auto-lint/auto-prettify tasks (which have
been getting slower due to complexity).
would a new RegExp count-method li
7 matches
Mail list logo