Es 6 some features
youtube tutorial: https://www.youtube.com/watch?v=IEf1KAcK6A8
1 let and scope,
2 const,
3 array function
4 default value
5 Object iteral extensions
6 detructerting object
1 let vs scope:
let không hoạt động trong scope (if hoac for ... nhưng hoạt động với function)chỉ hoạt động trong scope của nó. không sử dụng ngoài scope nó đang đứng.
phải khai báo trước khi sử dụng
DemoCode: https://github.com/nguyenthinhit996/sharefullcode/blob/master/javascript/es6/let.js
2 Const variable
nó khá giống với final của java. chỉ là con trỏ poiter chỉ,
vẫn có thể thay đổi cấu trúc bên trong object hoặc array. không được gán con trỏ đến vùng nhớ khác.
vẫn có thể thay đổi cấu trúc bên trong object hoặc array. không được gán con trỏ đến vùng nhớ khác.
DemoCode: https://github.com/nguyenthinhit996/sharefullcode/blob/master/javascript/es6/const.js
arrayfunction nó sẽ call this windown object. tranditional function nó sẽ call this current
3 Arrow function
Sự khác nhau của array function vs function truyền thống => khác nhau chỗ xử lí this.arrayfunction nó sẽ call this windown object. tranditional function nó sẽ call this current
DemoCode: https://github.com/nguyenthinhit996/sharefullcode/blob/master/javascript/es6/function.js
4 Default value
Áp dụng trên param function, trên destructoring
DemoCode: https://github.com/nguyenthinhit996/sharefullcode/blob/master/javascript/es6/defaultArgument.js
5 Object literal and template literals
Áp dụng cho khai báo object. Cộng chuỗi chứa các variable
DemoCode: https://github.com/nguyenthinhit996/sharefullcode/blob/master/javascript/es6/objectLiteral.js
https://github.com/nguyenthinhit996/sharefullcode/blob/master/javascript/es6/templateLiterals.js
undefined => default || undefined (có default sẽ lấy default ko thì vẫn là undefined)
only copied, not modified original.
Detructoring Array
can use rest operator ... to get all element
use skip some index arrays
use swap for some element of arrays.
Detructoring Object
use name exactly get property
can use alias
https://github.com/nguyenthinhit996/sharefullcode/blob/master/javascript/es6/templateLiterals.js
6 Detructoring
null => nullundefined => default || undefined (có default sẽ lấy default ko thì vẫn là undefined)
only copied, not modified original.
Detructoring Array
can use rest operator ... to get all element
use skip some index arrays
use swap for some element of arrays.
Detructoring Object
use name exactly get property
can use alias
DemoCode: https://github.com/nguyenthinhit996/sharefullcode/blob/master/javascript/es6/destructering.js
Happy research knowledge.
0 comments :
About Me

- Peter
- Tân An, Long An, Vietnam
- Hello everyone, I love programming, I love making friends with people all over the world.
Contact
Popular Posts
-
Preface Khái niệm Oauth và ApIs Scope and consent (phạm vi và sự đồng ý) Oauth Actor Oauth Tokens Front Back Channel Giả Xác thực Với Oa...
-
Persistence Context has two implemnet is JPA EntityManage and Hiberbate Session Example use Session of hiberate has exist github you can vi...
-
1 check Null and Undefined And primative datatype if(object){ // object is not null, undefined, 0, '', false. but it can empty({})...
-
Knowledge of collection in java Interface Iterator interface Collection interface List Interface Queue Interface Deque Interface Se...
-
For immutableuse equallist we simple use list.equal list it return true if content same. (compare index) //case true List<Integer> l...
-
youtube tutorial: https://www.youtube.com/watch?v=IEf1KAcK6A8 1 let and scope, 2 const, 3 array function 4 default value 5 Object iteral ext...
-
The one of Design Pattern Series, this is factory design for createnal pattern. Please read in the linked document. Link document: https:...
-
1 Copy Object in java Use = for immutable class ex: Integer , String or Wrapper classes Object Use Contructor has paramater copy, ObjectA...
-
JPA find() & getReference() in javax.persistence.EntityManager * find (): always call select from DB Use for select one entity from DB...
-
Preface Trong java có 3 kiểu so sánh đặc trưng như sau: + Sử dụng toán tử == : return Boolean Primitive thì so sánh giá trị thực, Reference ...
Post a Comment