moving all labs to old dir

This commit is contained in:
2026-02-26 21:55:48 +10:00
parent 76555d27a4
commit 4f1c66e838
132 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
function updateObject(oldObject, newObject) {
const [newKey, newValue] = Object.entries(newObject)[0];
if (newKey in oldObject) {
oldObject[newKey] += newValue;
} else {
oldObject[newKey] = newValue;
}
return oldObject;
}
const oldObject = { 1: 10, 2: 20, 3: 30 };
const newObject = { 2: 15 };
const updatedObject = updateObject(oldObject, newObject);
console.log(updatedObject);