You can use Object.keys() and map() to do this

var obj = {"1":5,"2":7,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0}
var result = Object.keys(obj).map((key) => [key, obj[key]]);

console.log(result);

Answer from Nenad Vracar on Stack Overflow
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ convert-object-to-array-of-objects-in-javascript
Convert object to array of objects in JavaScript
const objPerson = { "Amit_Age": 32, "Amit_Height": 174, "Amit_Weight": 66, "Yogesh_Age": 29, "Yogesh_Height": 169, "Yogesh_Weight": 59 }; const arrayOfObject = (objPerson = {}) => { const res = []; Object.keys(objPerson).forEach(el => { const part = el.split('_'); const person = part[0]; const info = part[1].toLowerCase(); if(!this[person]){ this[person] = { "name": person }; res.push(this[person]); } this[person][info] = objPerson[el]; }, {}); return res; }; console.log(arrayOfObject(objPerson)); [ { name: 'Amit', age: 32, height: 174, weight: 66 }, { name: 'Yogesh', age: 29, height: 169, weight: 59 } ] The following problem statement is solved using javascript methods like Object.keys and push method that traverses the array of elements in O(n) worst case time complexity .
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ how-to-convert-an-object-into-array-of-objects-in-javascript
How to Convert an Object into Array of Objects in JavaScript? - GeeksforGeeks
July 23, 2025 - Object.values() method extracts the property values of an object and returns them as an array, converting the original object into an array of objects.
๐ŸŒ
OneCompiler
onecompiler.com โ€บ javascript โ€บ 3ww4b7q6d
Convert Key, Values in an Object to Array - JavaScript - OneCompiler
Below are couple of ways to use arrow function but it can be written in many other ways as well. ... const numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] const squaresOfEvenNumbers = numbers .filter((ele) => ele % 2 == 0) .map((ele) => ele ** 2) console.log(squaresOfEvenNumbers) ...
๐ŸŒ
Favtutor
favtutor.com โ€บ articles โ€บ convert-object-to-array-javascript
Convert Object to Array in JavaScript (with code)
November 30, 2023 - We can use the forโ€ฆin loop to iterate over the keys of an object and store the keys and values of the object in separate arrays. This is a naive approach to convert object to array in JavaScript.
๐ŸŒ
SamanthaMing
samanthaming.com โ€บ tidbits โ€บ 76-converting-object-to-array
Converting Object to an Array | SamanthaMing.com
const array = [ ['one', 1], ['two', 2], ]; Object.fromEntries(array); // { one: 1, two: 2 } ... Note: This is extremely new, so support will be limited. Keep this in your knowledge box, but maybe wait a bit longer before you put it in your actual toolbox ๐Ÿงฐ ยท @podfeet: I wanted to create an object in a specific form, so I used object.keys to discover the indices of the specific elements I wanted to extract.
๐ŸŒ
Javatpoint
javatpoint.com โ€บ convert-object-to-array-in-javascript
Convert object to array in Javascript - Javatpoint
Convert object to array in Javascript - Convert object to array in Javascript with javascript tutorial, introduction, javascript oops, application of javascript, loop, variable, objects, map, typedarray etc.
๐ŸŒ
OneCompiler
onecompiler.com โ€บ javascript โ€บ 3ww3ua972
Converting Objects to Arrays - JavaScript - OneCompiler
Below are couple of ways to use arrow function but it can be written in many other ways as well. ... const numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] const squaresOfEvenNumbers = numbers .filter((ele) => ele % 2 == 0) .map((ele) => ele ** 2) console.log(squaresOfEvenNumbers) ...
Find elsewhere
๐ŸŒ
JavaScript Tutorial
javascripttutorial.net โ€บ home โ€บ convert an object to an array in javascript
Convert an Object to an Array in JavaScript
March 29, 2020 - To convert an object to an array you use one of three methods: Object.keys(), Object.values(), and Object.entries().
๐ŸŒ
Bobby Hadz
bobbyhadz.com โ€บ blog โ€บ javascript-convert-object-to-array-of-objects
Convert an Object to an Array of Objects in JavaScript | bobbyhadz
Use the `Object.values()` method to convert an object to an array of objects, e.g. `const arr = Object.values(obj)`.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ how-to-convert-object-to-array-in-javascript
How to Convert Object to Array in JavaScript? - GeeksforGeeks
August 5, 2025 - This is useful when you want to transform the object into a specific format, such as an array of objects where each object contains a key-value pair. ... This example demonstrates how to use Object.keys() and map() to convert an object into ...
๐ŸŒ
Medium
medium.com โ€บ chrisburgin โ€บ javascript-converting-an-object-to-an-array-94b030a1604c
Javascript, Converting an Object to an Array of Objects. | by Chris Burgin | Spark | Medium
December 16, 2017 - Today we are going to do the opposite, convert an object to an array of objects. You may be asking why, the answer is actually quite simple. In programing we are not always in control of the format in which our data is delivered to us. With this in mind it becomes important to understand how to convert our data into our desired format. Using newer Javascript features there is an easy one liner that can achieve this result using Object.values().
๐ŸŒ
YouTube
youtube.com โ€บ watch
How To Convert An Object To An Array In Javascript - YouTube
Hey guys, it's been quite a while since I last uploaded but I'm going to start uploading more tutorial-style videos, I promise! Sorry about the mic quality, ...
Published: January 24, 2023
๐ŸŒ
DEV Community
dev.to โ€บ awaisalwaisy โ€บ 7-ways-to-convert-objects-into-array-in-javascript-35m4
7 ways to convert Objects into Array in JavaScript - DEV Community
February 12, 2023 - The for...in loop is a traditional looping method in JavaScript to iterate over the properties (keys) of an object. It can be used to convert an object into an array by extracting its values and forming a new array with them.
๐ŸŒ
ServiceNow Community
servicenow.com โ€บ community โ€บ developer-forum โ€บ please-suggest-how-to-convert-object-to-array-in-javascript โ€บ m-p โ€บ 2657108
Please suggest how to convert object to array in javascript
August 30, 2023 - To convert an ordinary object that's not iterable or array-like to an array (by enumerating its property keys, values, or both), use Object.keys() , Object.values() , or Object.entries() . To convert an async iterable to an array, use Array.fromAsync() . Array.from() never creates a sparse array.
๐ŸŒ
SourceBae
sourcebae.com โ€บ home โ€บ how to convert object to array in javascript?
How to Convert Object to Array in Javascript? - SourceBae
August 21, 2025 - JavaScript doesnโ€™t provide a built-in method that directly converts deeply nested objects to arrays.
๐ŸŒ
Scaler
scaler.com โ€บ home โ€บ topics โ€บ convert an object to an array in javascript
Convert an Object to an Array in JavaScript - Scaler Topics
October 17, 2023 - Before the introduction of the Object.keys method in the ES6 and Object.values, Object.entries methods in ES8, there were no available methods to convert the object to array javascript.
๐ŸŒ
Medium
medium.com โ€บ @frontendinterviewquestions โ€บ convert-object-to-array-in-javascript-30de76da1d67
Convert object to array in JavaScript | by Pravin M | Medium
September 2, 2024 - One common approach to convert an object into an array is by utilizing the Object.keys() method to extract the keys of the object and then using Array.map() to transform them into an array of values.