Tell us what’s happening:
My function is returning the expected result but the tests fail.
Your code so far
function generateSnowflake(crystals) {
const extractedLines = crystals.split("\n");
let snowflake = "";
for (let i = 0; i < extractedLines.length; i++) {
snowflake += extractedLines[i] + extractedLines[i].split("").reverse().join("") + "\\n";
}
return snowflake.slice(0, -2);
}
console.log(generateSnowflake("* \n *\n* "));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0
Challenge Information:
Daily Coding Challenge - Snowflake Generator
https://www.freecodecamp.org/learn/daily-coding-challenge/2025-12-25