Friday, May 02, 2014

WDC 2.3 ES6 Data strutures

ES6 data structure

["key"] = test
is it data structure or inheritance?

construct from "from" methid

new data structure

- set
bucket of unique values
no duplicates
new Set()

- maps (like dictionary) or relationship
new Maps)

- weakMap (map without memory leak)
similar to map
only obj that u can map
references as weakly held

e.g if using map which reference other obj. and we remove it. then there is memory leak

easy way to write not to not memory leak

-weakSet (no memory leak set)


for(var [index,value] of array.entries){}

keys() values() are iterators

you can start using this by transfillers?

No comments: