lab 6 done

This commit is contained in:
2025-12-29 00:03:52 +10:00
parent 73ea28eab6
commit 4cc6b7e9d8
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)