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

Đếm số phần tử trong mảng JavaScript

Đếm số lần xuất hiện của các phần tử trong mảng JavaScript

Extend Object javascript

Extend Object javascript

encode/decode base64 with JS

Encoding to base64 is done with the btoa command

Spread Operator for Objects

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

await axios get

await axios get