Answers for "add to json object javascript"

3

how to add element in json object

// base code ----------------------------------------------------------
	object["property"] = value;
	 // or
	object.property = value;
// exampel : ----------------------------------------------------------
	var myJson = { name: "mamad", family: "mirzaei" }
// i wana to add age 
	myJson.age = 26
// log =>
	console.log( "myJson >>:" ,myJson) 
// resalt =>
	{ name: "Mamad", family: "Mirzaei", age : 26 }
Posted by: Guest on June-15-2020
0

add to json object javascript

object.property = value;
Posted by: Guest on March-29-2020

Code answers related to "add to json object javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language