News for hackers. Stuff that matters.
Re:JavaScript Temporal Is Coming by 65 on Thursday January 30, 2025 @10:30PM (#42884479)
Now try it with a constant:

    console.log(const x = "hello");
Doesn't work.
Re:JavaScript Temporal Is Coming by recursive on Thursday January 30, 2025 @10:45PM (#42884531)
That's a declaration. That would be cool. Doesn't currently work with let or var either.
Re:JavaScript Temporal Is Coming by 65 on Friday January 31, 2025 @11:14AM (#42888950)
I think this is basically assigning values to the window object, similar to updating values in any object.

e.g.

    const a = { b: 1 }
    console.log(a.b = 2); // logs 2
Re:JavaScript Temporal Is Coming by recursive on Friday January 31, 2025 @12:30PM (#42889628)
Only if you haven't already declared the variable. e.g.

    let x;
    console.log(x = 'hello');
My point is that the `x = 'hello'` part is an assignment, and an expression, and has the exact same semantics regardless of whether you use that expression as a statement. So, assignments would seem to be expressions.