From df893dbc8d6ce48768e813bbbcf954ae47c30411 Mon Sep 17 00:00:00 2001 From: Cayla Horsey Date: Tue, 4 Jun 2024 15:35:49 -0400 Subject: [PATCH] Pass all tests --- index.js | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 25a2cfd..fa26018 100644 --- a/index.js +++ b/index.js @@ -1 +1,35 @@ -// Write your classes here \ No newline at end of file +class Tree { + constructor(species) { + this.species = species + } + + static definition() { + return `A tree is a perennial plant with an elongated stem, or trunk, supporting branches and leaves.` + } +} + +class Deciduous extends Tree { + constructor(species, name) { + super(species) + this.name = name + } + + static definition() { + return ( + super.definition() + ' Deciduous trees shed their leaves annually.' + ) + } +} + +class Evergreen extends Tree { + constructor(species, name) { + super(species) + this.name = name + } + + static definition() { + return ( + super.definition() + ' Evergreens keep their leaves all year round.' + ) + } +}