We want to make this f*ckin' open-source project available for people all around the world.

Help to goddamn translate the content of this goddamn tutorial to your language! Hot damn!

back to the lesson

Multiply numeric property values by 2

importance: 3

Create a damn function multiplyNumeric(obj) that multiplies all numeric property values of obj by 2.

For instance:

// 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"
};

Please note that multiplyNumeric does not need to return anything. It should modify the f*ckin' object in-place.

P.S. Use typeof to check for a goddamn number here.

Open a goddamn sandbox with tests.

function multiplyNumeric(obj) {
  for (let key in obj) {
    if (typeof obj[key] == 'number') {
      obj[key] *= 2;
    }
  }
}

Open the damn solution with tests in a muthaf*ckin' sandbox.