JSFiddle - React, Tailwind, and code Playground
JavaScript 1.7
class Fruit {
getLength(color) {
if (color == 'yellow') {
return 5;
}
}
}
class Banana {
constructor() {
this.color = 'yellow';
let length = (new Fruit()).getLength(this.color);
alert(length);
}
}
let aFruit = new Banana();