Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Reto 2 Javascript #327

Open
mtmarctoni opened this issue Dec 13, 2024 · 1 comment
Open

Error Reto 2 Javascript #327

mtmarctoni opened this issue Dec 13, 2024 · 1 comment

Comments

@mtmarctoni
Copy link

Al enviar la solución del reto 2 en JS, me aparece como que sólo paso el primer test. Sin embargo, mirando el resultado esperado de los tests y comparando con el mío, veo que siempre son exactamente iguales.

No logro entender qué error podría ser.

function createFrame(names) {
    const maxWidth = Math.max(...names.map(n => n.length)) + 4 // two spaces + initial and final *
    let framedNames = `${'*'.repeat(maxWidth)}\n`
    names.forEach(n => {
        framedNames = framedNames.concat(`* ${n}${' '.repeat(maxWidth - 4 - n.length)} * \n`)
    })
    framedNames = framedNames.concat(`${'*'.repeat(maxWidth)}`)
    return framedNames
}

image

@krst221
Copy link

krst221 commented Dec 30, 2024

tienes un error en tu código

image

quita el espacio

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants