Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the use of Object.entries (), Object.values () and Object.keys () in js

Shulou Source: shulou.com Published: 2022-06-01 05:56:14 11月17日 Update

This article mainly shows you "what is the use of Object.entries (), Object.values () and Object.keys () in js?" the content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "what is the use of Object.entries (), Object.values () and Object.keys () in js?"

Object.entries () Object.values () Object.keys ()

Object.entries () this feature converts an object into an array of objects.

Object.values () can get the value of the object

Object.keys () can get the object key value

Const data = {test1: 'abc', test2:' cde'} const arr1 = Object.entries (data) const arr2 = Object.values (data) const arr3 = Object.keys (data) / * * arr1 Output: [['test1',' abc'], ['test2',' cde'],] * / / * * arr2 Output: ['abc',' cde'] * / / * arr3 Output: ['test1'' 'test2'] * / above are all the contents of the article "what is the use of Object.entries (), Object.values () and Object.keys () in js" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Objects content articles learning help array easy to understand more organization characteristics knowledge editing industry information information channels channels research Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Shulou Technology Apple MySQL Xiaomi