Use Object values method to convert nested JSON object to array in JavaScript. This method returns an array of a given object’s own enumerable property values.
Object.values(data)
Convert nested JSON object to array JavaScript
Simple HTML example code.
<!DOCTYPE html>
<html>
<body>
<script>
var data = {
code: 42,
items: {
item_1: {
id: 1,
name: 'foo'
},
item_2: {
id: 2,
name: 'bar'
},
item_3: {
id: 2,
name: 'bar'
}
}
};
const items = Object.values(data.items);
console.log(items);
</script>
</body>
</html>
Output:

Do comment if you have any doubts or suggestions on this JS JSON topic.
Note: The All JS Examples codes are tested on the Firefox browser and the Chrome browser.
OS: Windows 10
Code: HTML 5 Version

Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology & like learning technical.