-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
destructuring is not allowed (even if only a single variable is "pulled out"), as there's potential confusion as to what's actually being checked (the value vs. whether the desired key/index was present in the object/array)
While it might be confusing, it's also the reality of how JavaScript was designed.
const error = new TypeError("Some error");
let stack, message, name;
console.error(
{ stack, message, name } = error
);This will log the error object on the rhs to the console, regardless of whether or not one considers it confusing.
Is the argument that it could potentially be confusing, so strong that it would be denied here?
tolmasky, towerofnix, lazarljubenovic and snarbies
Metadata
Metadata
Assignees
Labels
No labels