Data update
This commit is contained in:
parent
72eb4943cb
commit
4d5544505c
2347 changed files with 62432 additions and 16731 deletions
|
|
@ -0,0 +1,15 @@
|
|||
import ballerina/io;
|
||||
|
||||
function mergeMaps(map<any> m1, map<any> m2) returns map<any> {
|
||||
map<any> m3 = {};
|
||||
foreach string key in m1.keys() { m3[key] = m1.get(key); }
|
||||
foreach string key in m2.keys() { m3[key] = m2.get(key); }
|
||||
return m3;
|
||||
}
|
||||
|
||||
public function main() {
|
||||
map<any> base = { "name": "Rocket Skates" , "price": 12.75, "color": "yellow" };
|
||||
map<any> update = { "price": 15.25, "color": "red", "year": 1974 };
|
||||
map<any> merged = mergeMaps(base, update);
|
||||
io:println(re `,`.replaceAll(merged.toString(), ", "));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue