I need to get the minimum and maximum values of each of these objects within the following array. I've tried everything I know but the returned value is undefined, how can I do this? NOTE: Afterwards, I need to do the same in a constructor function and in a factory function. Is it the same procedure?
let faixas3 = [
{tooltip: 'de R$ 6667 até R$ 7777', minimo: 6667, maximo: 7777},
{tooltip: 'de R$ 7778 até R$ 8889', minimo: 7778, maximo: 8889},
{tooltip: 'de R$ 9000 até R$ 10000', minimo: 9000, maximo: 10000}
];
const {tooltip, minimo, maximo} = faixas3;
console.log({tooltip, minimo, maximo}); // { tooltip: undefined, minimo: undefined, maximo: undefined }
console.log(tooltip, minimo, maximo); // undefined undefined undefined
[ ]not {},const [tooltip, minimo, maximo] = faixas3;, faixas3 is an array not an object.faixas3is an array, you're using object destructuring syntax.