This content originally appeared on CodeSource.io and was authored by Prince Chukwudire
In this article, you will learn how to convert JavaScript Objects into Arrays.
This we would achieve by using the following JavaScript object method; Object.keys()
.
const user = {
name: "Jane Doe",
occupation: "Student",
age:23
}
console.log(Object.keys(user))
This would throw us an array with these:
["name", "occupation", "age"]
The post Convert JavaScript Objects into Arrays appeared first on CodeSource.io.
This content originally appeared on CodeSource.io and was authored by Prince Chukwudire
Prince Chukwudire | Sciencx (2021-03-02T10:44:26+00:00) Convert JavaScript Objects into Arrays. Retrieved from https://www.scien.cx/2021/03/02/convert-javascript-objects-into-arrays/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.