On lines 82 and 86 the method’s name is missing
Car.prototype.startEngine = function () {
this.engineRunning = true;
};
Car.prototype.addGas = function (litre) {
// ...
};
It should be:
Car.prototype.startEngine = function startEngine() {
this.engineRunning = true;
};
Car.prototype.addGas = function addGas(litre) {
I’ve created a PR that fixes this on Update introduction.md by Ricardo-MaGuz · Pull Request #2392 · exercism/javascript · GitHub
iHiD
February 7, 2024, 11:39pm
2
Unless I’m missing something, is the name not is defined on the LHS?
Car.prototype.startEngine = function () {
Well I tried it that way on the coding exercise but it didn’t work out. After adding the name onthe inner function it worked. Maybe it’s a bug on the editor then.
iHiD
February 8, 2024, 12:57am
4
Do you have an example of where your code doesn’t work?
I’ve tried again in the IDE removing the function name declaration and worked. something weird must’ve happened. I’ll close the PR. Thanks Jeremy