I want to update my Object by adding a more key-value pair.
Object options = {
"first_name": "Nitish",
"last_name" : "Singh"
}
after initializing the Object I want to add one more key and value. Is there any way to do this.
after adding one more key-value pair my object will look like this
options = {
"first_name" : "Nitish",
"last_name" : "Singh"
"middle_name": "Kumar"
}
You can assign to a Map using the indexing operator
{}is aMapliteral to create aMapinstance. The result allows you to use all methods ofMaplike remove