Bad Code Practices in Import Lesson


The Import Lesson has us make a function called displayFuelCapacity, in which we display the fuel capacity of all the planes in our Airplanes object. I think that some of the code is bad practice.

First, the displayFuelCapacity should be a method of Airplane and not a function, seeing as it only makes sense inside that object. We couldn’t really call it on a different class that we worked with, say Animal, from before.

Second, there is no reason to not use a Template Literal instead of regular string notation. It’s less code, and it works.

Here is my code for the lesson:

import Airplane from './airplane';

Airplane.displayFuelCapacity = function(){
    console.log(`Fuel Capacity of ${}:` +
                ` ${element.fuelCapacity}.`);


Is there a reason why this isn’t okay for the lesson?