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
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Object › fromEntries
Object.fromEntries() - JavaScript - MDN Web Docs
October 30, 2025 - The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key.
🌐
Seanconnolly
seanconnolly.dev › javascript-object-to-array
JavaScript object to array · Sean Connolly
There are 3 JavaScript methods available to help us convert an object to an array.
🌐
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 ... pair. ... This example demonstrates how to use Object.keys() and map() to convert an object into an array of objects, where each object contains a key and value property....
🌐
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.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › from
Array.from() - JavaScript - MDN Web Docs
The Array.from() static method creates a new, shallow-copied Array instance from an iterable or array-like object.
🌐
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 😝) …
🌐
SamanthaMing
samanthaming.com › tidbits › 76-converting-object-to-array
Converting Object to an Array | SamanthaMing.com
Now, there was a built-in method that quickly turns all the keys in my object into an array: const numbers = { one: 1, two: 2, }; Object.keys(numbers); // [ 'one', 'two' ] Life was beautiful! But then I became angry again. Why can I only extract the keys, I want my values too!
Find elsewhere
🌐
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.
🌐
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().
🌐
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 - We then use map() to create an array containing each key and its corresponding value. ... let obj = { a: 1, b: 2, c: 3 }; // Get all keys and create key-value pairs let result = Object.keys(obj).map(key => [ key, obj[key] ]); console.log(result);
🌐
Medium
medium.com › @krunalkanojiya › how-to-convert-an-object-into-an-array-in-javascript-simple-guide-eccbebc2a782
How to Convert an Object into an Array in JavaScript (Simple Guide)
September 1, 2025 - var array = Object.keys(obj) .map(function(key) { return obj[key]; }); console.log(array); // ["hello", "this is", "javascript!"] See? Super clean. ... Object.keys(obj) gives us an array of keys → ["a", "b", "c"].
🌐
30 Seconds of Code
30secondsofcode.org › home › javascript › object › map object to array
Map a JavaScript object to an array - 30 seconds of code
March 22, 2024 - The simplest way to get the key-value pairs of an object is to use Object.entries(). Then, using Array.prototype.map() and a mapping function, you can map the key-value pairs to an array of objects.
🌐
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() .
🌐
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 - The Object.keys() and map() function are extracts keys and maps them to an array of objects using their corresponding values.
🌐
Quora
quora.com › What-is-the-easiest-way-to-convert-a-JavaScript-object-into-an-array
What is the easiest way to convert a JavaScript object into an array? - Quora
Answer: There are many easy ways to convert an object into an array, but it depends on what you want in the resulting array. Let’s take, for example, the following object: [code]const person = { name: "Ali", age: 33 } [/code]This object has two properties; name and age. To get the array of t...