“Contoh JSON” Kode Jawaban

Contoh JSON

{
    "name": "Muhammad Ishaq",
    "gender": "Male",
    "age": 23,
    "address": {
        "street": "87",
        "city": "Gultari Matyal Skardu",
        "state": "Gilgit Baltistan",
        "postalCode": "16350"
    },
    "phoneNumber": [
        { "type": "personal", "number": "116263747" }
    ]
}
Isaac

Buat objek JSON di JavaScript

var employee = {
  "firstName": firstName,
  "lastName": lastName
}
Precious Panther

Contoh data JSON

[{"_id":"60beb338abe3dd4300d844b8","email":"[email protected]","typeVaccine":"Moderna","status":"Yes","__v":0},{"_id":"60bf716b145de95f1c84fb2f","email":"[email protected]","typeVaccine":"Asternzcana","status":"No","__v":0},{"_id":"60bf7196145de95f1c84fb31","email":"[email protected]","typeVaccine":"Phizer","status":"Yes","__v":0},{"_id":"60bf758f145de95f1c84fb32","email":"[email protected]","typeVaccine":"none","status":"No","__v":0}]
Helpful Heron

objek json

var myObj, x;
myObj = {"name":"John", "age":30, "car":null};
x = myObj.name;
document.getElementById("demo").innerHTML = x;
Wide-eyed Wasp

Contoh JSON

 const x = {a:"aaaaa", b: function(){return this.a}, c: function(){this.a}};
 console.log(x.b());
/* const x = {a:"aaaaa", b:  this.a, c: this.a};
 console.log(x.b);
 will return undefined
*/
Javasper

JSON Gunakan contoh

function get(value, p)
{
console.log(p[value]);
}
get("x", {x:"XXX%%$$$%$%#$%#"});
Javasper

Jawaban yang mirip dengan “Contoh JSON”

Pertanyaan yang mirip dengan “Contoh JSON”

Lebih banyak jawaban terkait untuk “Contoh JSON” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya