Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

276
Vistas
TypeError: bcLi.push(...) is not a function

Hi everyone I'm pretty new to programming and don't really know how to fix errors. I got the code from my university and copied it 1:1. However I always get the error in the title. I think The teacher changed something and didn't change it in the documents she gave us. I googled the error and it seems to be pretty common but the structure is always different compared to my code. As I said I'm new to this and would also appreciate tips on how to fix things on my own in the future.

This is the code. Please let me know if you need more info or other code from another sheet.

import'./BreadCrumb.css';
import {crumbs} from'./data';

function BreadCrumb() {
//const crumbs=["Home","Service","Suche"];
let bcLi=[];
for (let i=0; i<crumbs.length-1;i++) 
{
  bcLi.push(<li className="breadcrumb-item" key={1}>{crumbs[i]}</li>);
}
bcLi.push()(<li className="breadrumb-item active" key={crumbs.length-1} 
aria-current="page">{crumbs[crumbs.length-1]}</li>);

return (
  <div className="bcd">
    <nav aria-aria-label="breadcrumb">
      <ol className="breadcrumb">
        {bcLi}
      </ol>
    </nav>
  </div>
);
}

export default BreadCrumb;
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

bcLi.push()(... needs to be bcLi.push(<li className="breadrumb-item active" key={crumbs.length-1} aria-current="page">{crumbs[crumbs.length-1]}</li>);

Final code:

import'./BreadCrumb.css';
import {crumbs} from'./data';

function BreadCrumb() {
//const crumbs=["Home","Service","Suche"];
let bcLi=[];
for (let i=0; i<crumbs.length-1;i++) 
{
  bcLi.push(<li className="breadcrumb-item" key={1}>{crumbs[i]}</li>);
}
bcLi.push(<li className="breadrumb-item active" key={crumbs.length-1} 
aria-current="page">{crumbs[crumbs.length-1]}</li>);

return (
  <div className="bcd">
    <nav aria-aria-label="breadcrumb">
      <ol className="breadcrumb">
        {bcLi}
      </ol>
    </nav>
  </div>
);
}

export default BreadCrumb;
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda