mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
24 lines
549 B
TypeScript
24 lines
549 B
TypeScript
//// [tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment8.ts] ////
|
|
|
|
//// [destructuringObjectBindingPatternAndAssignment8.ts]
|
|
const K = {
|
|
a: "a",
|
|
b: "b"
|
|
}
|
|
const { [K.a]: aVal, [K.b]: bVal } = (() => {
|
|
return { [K.a]: 1, [K.b]: 1 };
|
|
})();
|
|
console.log(aVal, bVal);
|
|
|
|
|
|
//// [destructuringObjectBindingPatternAndAssignment8.js]
|
|
"use strict";
|
|
const K = {
|
|
a: "a",
|
|
b: "b"
|
|
};
|
|
const { [K.a]: aVal, [K.b]: bVal } = (() => {
|
|
return { [K.a]: 1, [K.b]: 1 };
|
|
})();
|
|
console.log(aVal, bVal);
|