Build a Heritage Library Catalog - Step 30

Tell us what’s happening:

Having problems with this one, think I must be missing something as I really cant understand what I meant to be comparing the year with

Your code so far

// User Editable Region

console.log(catalog.length);
console.log(Object.keys(byDecade).length);

let oldestYear = Infinity;
let newestYear = 0;

for (let i = 0; i < catalog.length; i++) {
  if (catalog.year[i] !== "Unknown") {
    if (catalog.year[i] < ) {
  oldestYear = catalog.year[i];
}
 if (catalog.year[i] > ) {
  newestYear = catalog.year[i];
}
  }
  console.log(newestYear);
  console.log(oldestYear);
}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36 Edg/147.0.0.0

Challenge Information:

Build a Heritage Library Catalog - Step 30

hello!

You are supposed to compare the year of each entry with the oldestYear and newestYear separately.

If the entry’s year is less than oldestYear, change oldestYear to that year.

And If entry’s year is more than newestYear, change newestYear to that year.

Then log both the values after the for loop.

This doesn’t seem to be correct for the entry’s year. Please try to correct it.