Convert objects values to array

suggest change

Given this object:

var obj = {
    a: "hello",
    b: "this is",
    c: "javascript!",
};

You can convert its values to an array by doing:

var array = Object.keys(obj)
    .map(function(key) {
        return obj[key];
    });

console.log(array); // ["hello", "this is", "javascript!"]

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents