lab 6 done

This commit is contained in:
2025-12-29 00:12:40 +10:00
parent 4316ac1636
commit 7b1c5b0a50
2 changed files with 36 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
function updateDict(dict, update) {
let key, value = update.entries()[0];
dict[key] = value + (key in dict) ? dict[key] : 0;
}
aboba={"asd":123}
upd={"asd":123}
upd1={"asd":123}
updateDict(aboba,upd1)
console.log(aboba)
updateDict(aboba,upd1)
console.log(aboba)