You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
But if the x, y is in an array, for example [ 'x', 'y' ], generated in runtime, I don't know those keys when coding, maybe we need this kind of syntax:
constkeys=['x','y'];// syntax error here, some new syntax is neededlet{ ...keys, ...z}={x: 1,y: 2,a: 3,b: 4};x;// 1y;// 2z;// { a: 3, b: 4 }
The text was updated successfully, but these errors were encountered:
@liyuanqiu As lexical scope, all identifiers have to be declared first. So there is no way to magically create xy unless we introduce dynamic scope (like obsolete with statement in non-strict ES5).
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
We know we can get the rest entries of an object:
But if the x, y is in an array, for example [ 'x', 'y' ], generated in runtime, I don't know those keys when coding, maybe we need this kind of syntax:
The text was updated successfully, but these errors were encountered: