javascript-learner/4.1object/t4.js
2024-06-02 12:22:16 +02:00

23 lines
331 B
JavaScript

// before the call
let menu = {
width: 200,
height: 300,
title: "My menu"
};
multiplyNumeric(menu);
// after the call
menu = {
width: 400,
height: 600,
title: "My menu"
};
function multiplyNumeric(menu){
for(prop in menu){
if(typeof menu[prop] == 'number'){
menu[prop] *= 2;
}
}
}