Create a function multiplyNumeric(objectExample) that multiplies all numeric properties of objectExample by 2. Where may be my mistake?
let objectExample = {
width: 200,
height: 300,
title: 'example'
}
let multiplyNumeric = (key, object) => {
for (let key in object) {
if (typeof object.key === 'number') {
object.key *= 2;
}
}
}
multiplyNumeric(objectExample);
console.log(objectExample);
Thank You very much.