Q: What's the benefit of using an array of key: value pairs over a single object? In a few different places I've seen the following being used:
const arr = [
  { key: "someKey", value: 1 },
  { key: "anotherKey", value: true },
  { key: "yetAnotherOne", value: "hello world" },
];

To me, it seems more logical to use this structure:
const ob = {
  someKey: 1,
  anotherKey: true,
  yetAnotherOne: "hello world",
};

Is there an advantage when using an array like this?

A: Arrays are explicitly ordered.

A: An array is typically used for a list of similar objects. Some advantages would be:

*

*having a selection of array-specific methods to e.g. to filter/sort the objects

*In an array of objects it would be possible to use the same key-property multiple times. In an object these would be overwritten.

That's all I could think of. Hope it's helpful ;).
That said I would normally recommend using an object if the above is not relevant.

A: In your example, it would be better to use the object because it means you can access the value of the property faster and easier using something like ob.anotherKey without having to use a loop or having to know the index in the array.
However, this might not always be the case...
Slightly different from the example above:
const people = [
  { firstName: "someKey", lastName: 1 },
  { firstName: "anotherKey", lastName: true },
  { firstName: "yetAnotherOne", lastName: "hello world" },
];

Is much easier to understand and a better representation of the data and than...
const people = {
  someKey: 1,
  anotherKey: true,
  yetAnotherOne: "hello world",
};

This also requires previous knowledge that each key is the firstName and each value is the lastName.
