Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

275
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!