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

156
Views
TypeError: Undefined property of array

I am making a sorting algo visualizer and i am getting this error(Cannot read properties of undefined (reading 'map')) in line let bars = this.state.array.map((value, index) => here is my code. The whole code at below link error at line(165) : https://codebeautify.org/alleditor/y220e1b19

Thanks in Advance

render() {
    let bars = this.state.array.map((value, index) => 
    // console.log(`The ${index} is ${ceo}`);
    { 
        return (
        <Bar
            key={index}
            index={index} 
            length={value}
            color={this.state.colorKey[index]}
            changeArray={this.changeArray}
        />
        );
        });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Should render be define as?

Render = () => {
}

If above doesn't help have you put a break point to see which part of

this.state.array.map((value, index) =>

is undefined?

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!