Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use let for es6 instead of var in destructuring #116

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions features.txt
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,8 @@ Array Matching

Intuitive and flexible destructuring of Arrays into individual variables during assignment.

6| var list = [ 1, 2, 3 ];
6| var |[ a, , b ] = list|;
6| let list = [ 1, 2, 3 ];
6| let |[ a, , b ] = list|;
6| [ |b, a| ] = [ |a, b| ];

5| var list = [ 1, 2, 3 ];
Expand All @@ -472,7 +472,7 @@ Object Matching, Shorthand Notation

Intuitive and flexible destructuring of Objects into individual variables during assignment.

6| var |{ op, lhs, rhs }| = getASTNode();
6| let |{ op, lhs, rhs }| = getASTNode();

5| var |tmp| = getASTNode();
5| var |op = tmp.op|;
Expand All @@ -484,7 +484,7 @@ Object Matching, Deep Matching

Intuitive and flexible destructuring of Objects into individual variables during assignment.

6| var { op: a, |lhs: { op: b }|, rhs: c } = getASTNode();
6| let { op: a, |lhs: { op: b }|, rhs: c } = getASTNode();

5| var tmp = getASTNode();
5| var a = tmp.op;
Expand All @@ -496,10 +496,10 @@ Object And Array Matching, Default Values

Simple and intuitive default values for destructuring of Objects and Arrays.

6| var obj = { a: 1 };
6| var list = [ 1 ];
6| var { a, |b = 2| } = obj;
6| var [ x, |y = 2| ] = list;
6| let obj = { a: 1 };
6| let list = [ 1 ];
6| let { a, |b = 2| } = obj;
6| let [ x, |y = 2| ] = list;

5| var obj = { a: 1 };
5| var list = [ 1 ];
Expand Down