Last active
January 12, 2019 04:06
-
-
Save tranduclinh2067/89742a36cbf7abb20f541b6bb145eeca to your computer and use it in GitHub Desktop.
Phân tách cơ cấu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tách các phần tử của Array hoặc Object thành nhiều biến chỉ bằng một đoạn code duy nhất. | |
//Array [a,b,c] | |
let date_Array = [20,06,1997] | |
let [,, c] = date_Array; | |
console.log(c); | |
//Object {d,m,y} | |
let date_Object = { day : 20, month : 06, year : 1997 } | |
let {day : d, month : m, year : y} = date_Object; | |
console.log(y); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment