Arrays VS Sets
const taskArrays = ['code', 'Eat', 'code'];
console.log(taskArrays);
//["code", "Eat", "code"]
Use when you need
ordered
list of values (might contains duplicates) Use when you need to
manipulate
data
const taskSets = new Set(['code', 'Eat', 'code']);
console.log(taskSets);
//{"code", "Eat"}
Use when you need to work with
unique
values Use when
High-performance
is really important Use to
remove
duplicates from arrays
by გიორგი ბაკაშვილი
4 years ago
0
Pro tip: use ```triple backticks around text``` to write in code fences