objects and functions

PHOTO EMBED

Mon Jun 27 2022 19:14:15 GMT+0000 (Coordinated Universal Time)

Saved by @cruz #javascript

let giraffe = {
  species: "Reticulated Giraffe",
  name: "Cynthia",
  weight: 1500,
  age: 15,
  diet: "leaves"
};

function birthday(animal) {
    animal.age = animal.age + 1;
    return animal;
}

console.log(giraffe.age);

birthday(giraffe);

console.log(giraffe.age);
content_copyCOPY

https://education.launchcode.org/intro-to-professional-web-dev/chapters/objects-and-math/codingwithobjects.html