Records
Creating records
// Example: create a record with two members labelled 'name' and 'latinName'.
let animal = {
name: "Koala",
latinName: "Phascolarctos cinereus"
};
// We can now access the members using dot notation:
// animal.name, or
// animal.latinName
let animalName = animal.name;// Example: create a nested record
let city = {
name: "Kyoto",
location: {
latitude: "35.011665",
longitude: "135.768326"
}
};
// Now we can access the inner record using dot nation
let longitude = city.location.longitude;Accessing members
Updating records
The types of records
Last updated
Was this helpful?