append to map code example

Example 1: append to map javascript

var myMap = {};

myMap[newKey] = newValue;

// ...


// Another method

var myMap = new Map()
myMap.set("key0","value")
// ...
myMap.has("key1"); // evaluates to false, assuming key1 wasn't set

Example 2: appending map into map golang

for _, note := range notes {
        thisNote := map[string]string{
            "Title":note.Title,
            "Body":note.Body,
        }

        content["notes"] = append(content["notes"], thisNote)
}

Example 3: appending map into map golang

{ "notes": 
    {
    "Title":note.Title,
    "Body":note.Body,
    },
    {
    "Title":note.Title,
    "Body":note.Body,
    },
    {
    "Title":note.Title,
    "Body":note.Body,
    },
}