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
๐ŸŒ
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 ...
๐ŸŒ
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.
๐ŸŒ
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 the enumerable string-keyed properties of an object to an array, you use the Object.entries() method.
๐ŸŒ
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.
๐ŸŒ
YouTube
youtube.com โ€บ shorts โ€บ EaEw3PU1bN4
Convert Object to Array in JavaScript: Quick & Easy Trick - YouTube
"In this short, learn how to quickly convert an object to an array in JavaScript with a simple method. Whether you're working with Object.keys(), Object.valu...
Published: October 23, 2024
๐ŸŒ
OneCompiler
onecompiler.com โ€บ javascript โ€บ 3ww4b7q6d
Convert Key, Values in an Object to Array - JavaScript - OneCompiler
//Object spread const post = { ...options, type: "new", } //array spread const users = [...adminUsers, ...normalUsers]
๐ŸŒ
OneCompiler
onecompiler.com โ€บ javascript โ€บ 3ww3ua972
Converting Objects to Arrays - JavaScript - OneCompiler
//Object spread const post = { ...options, type: "new", } //array spread const users = [...adminUsers, ...normalUsers]
Find elsewhere
๐ŸŒ
SamanthaMing
samanthaming.com โ€บ tidbits โ€บ 76-converting-object-to-array
Converting Object to an Array | SamanthaMing.com
Finally with ES2017, it's official now! We have 3 variations to convert an Object to an Array in JavaScript
๐ŸŒ
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.
๐ŸŒ
EDUCBA
educba.com โ€บ home โ€บ software development โ€บ software development tutorials โ€บ javascript tutorial โ€บ convert object to array javascript
Convert Object to Array Javascript | Working with Examples
April 17, 2023 - We can convert the object to arrays in javascript; we will follow the default methods like Object.keys(),Object.values() and Object.entries(); using these methods, we will transform the javascript instance or object into the array format.
Address: Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
๐ŸŒ
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.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ article โ€บ how-to-convert-an-object-into-an-array-in-javascript
How to convert an object into an array in JavaScript?
March 15, 2026 - The Object.keys() method returns an array of an object's property names: const student = { name: "Chris", age: 25, marks: 85, city: "New York" }; const keysArray = Object.keys(student); console.log(keysArray); ... const student = { name: "Chris", ...
๐ŸŒ
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
๐ŸŒ
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() .
๐ŸŒ
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 - In JavaScript, dealing with an object having a long list of properties can be challenging, for example - printing all values into the object requires iterating over the object and printing the individual key-value. To make the object easy to use, we have Object methods that give the power to convert object to array javascript.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ how-to-convert-an-object-to-an-array-of-key-value-pairs-in-javascript
Convert an Object to JavaScript Array - GeeksforGeeks
August 19, 2026 - The simplest approach is to use the Object.entries() method, which directly returns an array containing the object's own enumerable key-value pairs. ... let obj = { a: 1, b: 2, c: 3 }; // Convert object into an array of key-value pairs let result ...
๐ŸŒ
Medium
medium.com โ€บ dailyjs โ€บ converting-object-to-an-array-in-javascript-c7147f2ff750
Converting Object to an Array in JavaScript | by Samantha Ming | Medium
November 4, 2019 - Converting Object to an Array in JavaScript Finally, with ES2017, itโ€™s official now! We have 3 variations to convert an Object to an Array ๐ŸŽŠ Array has an array of methods (sorry, bad pun ๐Ÿ˜) โ€ฆ
๐ŸŒ
All In One
license.pmmc.gov.gh โ€บ home โ€บ new โ€บ convert object to array javascript
Convert Object To Array Javascript - All In One
February 28, 2026 - Discover the fastest ways to Convert Object To Array Javascript with concise code snippets. This tutorial explains object-to-array conversion, property enumeration, ES6 features, and practical use cases, enabling developers to transform JSON objects into arrays for clean, efficient data handling.