===== ISTEM =====
Solve the following programming task.

TASK: Object Diff

Write a function 'objectDiff(obj1, obj2)' that compares two JavaScript objects and returns only the changed properties as [oldValue, newValue].

STARTER CODE (javascript):
function objectDiff(obj1, obj2) {
  // Write your code here
}

module.exports = { objectDiff };


RULES:
- Keep the function name and signature EXACTLY as given.
- Return working code only. No explanations.
- Put the code in a single ``` block.
- Try to solve it first. If you genuinely cannot, write only this single
  line instead of producing faulty code: CANNOT_SOLVE

===== HAM YANIT =====
```javascript
function objectDiff(obj1, obj2) {
  function deepEqual(a, b) {
    if (a === b) return true;
    if (typeof a !== typeof b) return false;
    if (a === null || b === null) return false;
    if (typeof a !== 'object') return false;
    if (Array.isArray(a) !== Array.isArray(b)) return false;
    const keysA = Object.keys(a);
    const keysB = Object.keys(b);
    if (keysA.length !== keysB.length) return false;
    return keysA.every(function (k) {
      return Object.prototype.hasOwnProperty.call(b, k) && deepEqual(a[k], b[k]);
    });
  }

  const diff = {};
  const keys = new Set([...Object.keys(obj1 || {}), ...Object.keys(obj2 || {})]);

  keys.forEach(function (key) {
    const oldValue = obj1 ? obj1[key] : undefined;
    const newValue = obj2 ? obj2[key] : undefined;
    if (!deepEqual(oldValue, newValue)) {
      diff[key] = [oldValue, newValue];
    }
  });

  return diff;
}

module.exports = { objectDiff };
```