вот мой: -)
function objOfMatches(arr1, arr2, cb) {
const len = Math.max(arr1.length, arr2.length);
const oResult = {};
for (let i = 0; i < len; i++) {
if (cb(arr1[i]) === arr2[i]) {
oResult[arr1[i]] = arr2[i];
}
}
return oResult;
}
var arr1 = ['hi', 'howdy', 'bye', 'later', 'hello'];
var arr2 = ['HI', 'Howdy', 'BYE', 'later', 'HELLO'];
function uppercaser(str) { return str.toUpperCase(); }
console.log(objOfMatches(arr1, arr2, (str) => {
return (str || '').toUpperCase();
})); // should log: { hi: 'HI', bye: 'BYE', hello: 'HELLO' }