<>Object.values() Usage of

<>1, grammar
<> parameter

obj: Objects returned with enumerable property values .

<> Return value

An array containing all enumerable property values of the object itself .

<>2, describe

Object.values() Returns an array , Its element is the enumerable property value found on the object . The order of properties is the same as that given by manually cycling the property values of an object .

<>3, Example
var obj = { foo: 'bar', baz: 42 }; console.log(Object.values(obj)); // ['bar',
42] // array like object var obj = { 0: 'a', 1: 'b', 2: 'c' }; console.log(
Object.values(obj)); // ['a', 'b', 'c'] // array like object with random key
ordering // when we use numeric keys, the value returned in a numerical order
according to the keys var an_obj = { 100: 'a', 2: 'b', 7: 'c' }; console.log(
Object.values(an_obj)); // ['b', 'c', 'a'] // getFoo is property which isn't
enumerable var my_obj = Object.create({}, { getFoo: { value: function() { return
this.foo; } } }); my_obj.foo = 'bar'; console.log(Object.values(my_obj)); //
['bar'] // non-object argument will be coerced to an object console.log(Object.
values('foo')); // ['f', 'o', 'o']

If you want to Object.values Compatible with old environments that do not support it , Available at tc39/proposal-object-values-entries or
es-shims/Object.values Found in Polyfill .

according to Object.keys() Of Polyfill Copy one :
if (!Object.values) Object.values = function(obj) { if (obj !== Object(obj))
throw new TypeError('Object.values called on a non-object'); var val=[],key; for
(key in obj) { if (Object.prototype.hasOwnProperty.call(obj,key)) { val.push(obj
[key]); } } return val; }
<>5, standard

<>6, Browser compatible

©2019-2020 Toolsou All rights reserved,
Note 14 : The second biggest obstacle to motivating others in R & D management vue vue-element-admin Summary of the project ( Essence )2020 year 7 month 30 day Wechat applet Use of modules vs2017, establish C++Win32 Windows Forms Application MySql sentence Recursively find all subordinate departments of an input department ( Essence )2020 year 6 month 26 day C# Class library Enum( Extension method )tfrecord How to use the format Share has surpassed Ningde Era !LG Chemical confirmation to spin off battery business unit 415 Status code to background error subversion ! Never take a nap longer than this time ! Watch out for fatal diseases …