Converting Object to an Array

array,tipjs

Converting Object to an Array

const zoo = {
  lion: '🦁',
  panda: '🐼',
};

Object.keys(zoo);
// ['lion', 'panda']

Object.values(zoo);
// ['🦁', '🐼']

Object.entries(zoo);
// [ ['lion', '🦁'], ['panda', '🐼'] ]

Có thể bạn đã miss một số snippets code

Spread Operator for Objects

Using the spread operator during an Object declaration will assign the properties of the referenced Object to the new Object.

Promise + gì

promise + gì

Random String

Random String với độ dài tuỳ chọn

Object.keys và Object.getOwnPropertyNames

Object.keys và Object.getOwnPropertyNames

try/catch es10

An update for developer convience allows the use of try/catch without an explicit e Error reference in the catch call.