The two arrays contain a different number of values, so they are clearly not equal to each other.
And even if they contained exactly the same values, Javascript only considers reference equality when applying the equality operator to arrays. Two different arrays containing exactly the same values will not be considered equal.
To properly test whether two arrays are equal, you need to test that they are the same length, and that each value is equal:
function arrayEquals(a, b) {
return Array.isArray(a) &&
Array.isArray(b) &&
a.length === b.length &&
a.every((val, index) => val === b[index]);
}
if (arrayEquals(costHrns, personHrns)) {
console.log("true");
}
But as I said, that clearly won't work for your arrays, since they contain a different number of values.
You need to debug your code to find out why the source arrays don't contain the data you think they should contain. Nobody else can do that for you.