JSFiddle - React, Tailwind, and code Playground

JavaScript

const list = [{
  test: "a",
  test2: "aa"
}, {
  test: "b",
  test2: "bb"
}]
list.forEach(function(item) {
  if (typeof item === 'object') {
    let keys = Object.keys(item)
    keys.forEach((key) => {
      console.log(key, item[key]);
    });
  }
});