79807181

Date: 2025-11-02 14:24:27
Score: 1
Natty:
Report link
function myFunction(myObject, myArray) {
  const value = myArray.pop();
  const lastKey = myArray.pop();
  const innerObject = myArray.reduce((obj, key) => {
    if (!(obj[key] instanceof Object)) {
      obj[key] = {};
    }
    return obj[key];
  }, myObject);
  innerObject[lastKey] = value;
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: SaujasByt