Tell us what’s happening:
I am trying my JS code function launchFuel() and in my console.log(), the answer is returned correctly.
But the tests in FCC’s console returns otherwise.
Your code so far
function launchFuel(payload) {
let totalLoad = payload;
let initialFuelRequired = totalLoad / 5;
let currentFuelRequired = totalLoad / 5;
do {
totalLoad = payload + initialFuelRequired;
currentFuelRequired = totalLoad / 5;
fuelDifference = currentFuelRequired - initialFuelRequired;
initialFuelRequired = currentFuelRequired;
} while (fuelDifference >= 1);
return Math.round(currentFuelRequired * 10) / 10;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36
Challenge Information:
Daily Coding Challenge - Space Week Day 7: Launch Fuel
https://www.freecodecamp.org/learn/daily-coding-challenge/2025-10-10