lab 6 done
This commit is contained in:
17
lectures/temp.js
Normal file
17
lectures/temp.js
Normal 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)
|
||||
Reference in New Issue
Block a user