Object.keys
- This pulls the keys of an object and puts them into an array. for ex.
{flavor: cherry,
price: 12.99,
size: large}
Object.values
Object.entries
Object.keys
{flavor: cherry,
price: 12.99,
size: large}
Object.values
Object.entries
For further actions, you may consider blocking this person and/or reporting abuse
Ukwueze Onyedikachi -
Akshat Sharma -
Siji Chen -
Suraj Chandrakar -
Top comments (1)
Set is helpful if you want to return unique values from an array.
if you had an array of people's favorite pokemon, and you wanted to see how many unique Pokemon there were... numbers const pokePals = ["Lapras", "Wartortle", "Gyrados", "Dragonair", "Gyrados", "Kingdra", "Lapras", "Bulbasaur"];
If you wanted a list that showed all the Pokemon that had favorite votes without seeing duplicates,
const favs = [...new Set(pokePals)];