Skip to content

Destructuring (ES6) #240

Closed
Closed
@RyanCavanaugh

Description

@RyanCavanaugh

Example

var [x,y] = myFun();

Codegen

var __a = myFun(); // fresh var __a
var x = __a[0];
var y = __a[1];

Type annotations

// {x: myX} is a ES6 destructuring with renaming, this looks awkward
var {x: myX: number, y: myY: number} = myPoint();
// Moving type annotation to beside destructuring left hand side
var {x: myX, y: myY}: {x: ...; y: ...} = myPoint();

Metadata

Metadata

Assignees

Labels

ES6Relates to the ES6 Spec

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions