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

closure javascript

closure javascript

Sự khác biệt giữa substr và substring

Sự khác biệt giữa substr() và substring() chức năng trong JS là gì?

Lấy tháng hiện tại trong javascript

Lấy tháng hiện tại trong javascript

Random Number javascript

Random Number javascript

Merge Array

How to combine two sorted arrays into one? We can do this easily with the spread operator.