You could use Array.map here

var arr = oldArr.map(function(obj){
    var key = Object.keys(obj).sort()[1], rtn = {};    
    return rtn[key] = obj[key], rtn;
});

What you're doing is taking the second key and then returning a new Object with that key and value.

Answer from Amit Joki on Stack Overflow
🌐
TutorialsPoint
tutorialspoint.com › from-json-object-to-an-array-in-javascript
Create array from JSON object JavaScript
Following are the steps to create an array from JSON data using a for-loop ? Input Data: The same JSON array studentDetails. Iteration: A for loop iterates over the array using an index (i). Extraction: The name property of each object is accessed using studentDetails[i].name and added to the listOfStudentNames array using the push() method.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-get-a-value-from-a-json-array-in-javascript
How to Get a Value from a JSON Array in JavaScript? - GeeksforGeeks
June 28, 2025 - To retrieve a value from a JSON array in JavaScript, we can use various methods such as accessing the array by index or using built-in methods like find(), map(), etc. In a JSON array, values are stored in an ordered list, which means you can ...
🌐
W3Schools
w3schools.com › js › js_json_server.asp
<h1>JavaScript Loading JSON</h1>
JS Examples JS HTML DOM JS HTML Input JS HTML Objects JS HTML Events JS Browser JS Editor JS Exercises JS Quiz JS Website JS Syllabus JS Study Plan JS Interview Prep JS Certificate ... JSON is often stored in files or returned by calls to web servers. JavaScript can load JSON and convert it into JavaScript values.
🌐
YouTube
youtube.com › watch
How to get JSON data Array value access || JSON Basics - YouTube
JSON Course covers everything from start to finish to get you using JSON quickly!•Learn the basics of JSON •JSON structure data of delivery•basics of JavaScr...
Published: March 25, 2016
Find elsewhere
🌐
W3Schools
w3schools.com › js › js_json_parse.asp
JavaScript JSON.parse()
After parsing, object properties can be accessed with normal JavaScript syntax. Convert a JSON text into a JavaScript array.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript-json-arrays
JavaScript | JSON Arrays | GeeksforGeeks
May 28, 2021 - Once the data is received by the browser, it can be converted from a JSON string into a JavaScript object using the `JSON.parse()` method. However, XHR encounters an issue known as the **same-origin policy**. T ... JavaScript Array is used to store multiple elements in a single variable.
🌐
Squash
squash.io › how-to-convert-json-object-to-javascript-array
How to Convert JSON Object to JavaScript Array - Squash Labs
One way to convert a JSON object to a JavaScript array is by using the Object.values() method. This method returns an array of the property values of an object.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › JSON › parse
JSON.parse() - JavaScript - MDN Web Docs
5 days ago - The Object, Array, string, number, boolean, or null value corresponding to the given JSON text. ... Thrown if the string to parse is not valid JSON. JSON.parse() parses a JSON string according to the JSON grammar, then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from ...
🌐
TutorialsPoint
tutorialspoint.com › javascript-how-to-get-all-name-values-in-a-json-array
JavaScript How to get all 'name' values in a JSON array?
Let’s say the following is our JSON array − · To get only the CustomerName values, use the concept of map() −
🌐
GeeksforGeeks
geeksforgeeks.org › how-to-convert-json-string-to-array-of-json-objects-using-javascript
Convert JSON String to Array of JSON Objects in JavaScript | GeeksforGeeks
December 4, 2024 - These objects are quite different from JavaScript’s primitive data types (Number, String, Boolean, null, undefined, and symbol). Methods to convert the Objects to JavaScript Array:1. Using Obje ... Pre-requisite: JavaScript JSON JSON (JavaScript Object Notation) is a lightweight data-interchange format.
🌐
ServiceNow Community
servicenow.com › community › developer-forum › how-to-get-the-values-from-json-of-array › m-p › 2555131
Solved: Re: How to get the values from json of array - ServiceNow Community
May 8, 2023 - var parsed = JSON.parse(JSON.stringify(obj)); // No need for JSONParser var length = parsed.items.length; gs.log(length); for (var i = 0; i < length; i++) { var item = parsed.items[i]; gs.log("Item ====" + item.displayName); var systemDevices = item.systemDevices; var systemDevicesLength = ...
🌐
freeCodeCamp
freecodecamp.org › news › json-stringify-example-how-to-parse-a-json-object-with-javascript
JSON Stringify Example – How to Parse a JSON Object with JS
January 5, 2021 - The easiest way to get data from an API is with fetch, which includes the .json() method to parse JSON responses into a usable JavaScript object literal or array automagically.