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);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter