Coding task · JavaScript and TypeScript course · Module 2: Functions, Arrays and Objects
Exercise: Create a Variable Storing a Dinosaur Species
const species = 'Tyrannosaurus Rex' - constant like DNA, it will never change. let age = 25 - can change like a dinosaur's age. Text goes in quotes, a number does not.
Task
Create a constant species holding a dinosaur species name as text, e.g. 'Tyrannosaurus Rex', and a variable age (let) with the age 25. After the birthday change age to 26 and display species and age in the console.