What is the use of Object.entries (), Object.values () and Object.keys () in js
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!