“Exemple JSON” Réponses codées

Exemple 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

Créer un objet JSON dans JavaScript

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

Exemple de données 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

objet JSON

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

Exemple 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 utilise l'exemple

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

Réponses similaires à “Exemple JSON”

Questions similaires à “Exemple JSON”

Plus de réponses similaires à “Exemple JSON” dans JavaScript

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code