Class array object, how to get the value of the object

there is such an array [{a: 1}, {b: 30}, {d: 45}, {f: 415}, {cs: 454}];
how can I get the value of d

Mar.03,2021

this is not an array object, this is an array.

function getVal (arrLike, key, fallbackVal) {
  const result = [...arrLike].find(x => typeof x[key] === 'number')
  return result ? result[key] : fallbackVal
}

getVal(arrLike, 'd') // 45
Menu