# \[issue\] Hi can't find the problem in my code . I am new thanks

**URL:** https://discourse.processing.org/t/issue-hi-cant-find-the-problem-in-my-code-i-am-new-thanks/27099
**Category:** Beginners
**Created:** [January 15, 2021, 6:05pm UTC](https://discourse.processing.org/t/issue-hi-cant-find-the-problem-in-my-code-i-am-new-thanks/27099 "2021-01-15T18:05:52Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![brono](https://avatars.discourse-cdn.com/v4/letter/b/90db22/32.png) [@brono](https://discourse.processing.org/u/brono)
#### Post date: [January 15, 2021, 6:05pm UTC](https://discourse.processing.org/t/issue-hi-cant-find-the-problem-in-my-code-i-am-new-thanks/27099/1 "2021-01-15T18:05:52Z")

</div>

I was following The coding train video 7.4. link::

**\> [https://www.youtube.com/watch?v=fBqaA7zRO58&list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA&index=29&ab\_channel=TheCodingTrain](https://www.youtube.com/watch?v=fBqaA7zRO58&list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA&index=29&ab_channel=TheCodingTrain)**

and I can’t find the problem I am facing. it says Uncaught TypeError: Cannot read property ‘move’ of undefined (sketch: line 24).  
Here is my code

```auto
let bubble = [];

function setup() {
  createCanvas(600, 400);
}

function mousePressed() {
  let r = random(10, 50);
  let b = new Bubble(mouseX, mouseY, r);
  bubble[0] = b;

}

function draw() {
  background(140, 140, 20);
  for (i = 0; i <= bubble.length; i++) {
    bubble[i].move();
    bubble[i].show();
  }
}

class Bubble {
  constructor(x, y, r) {
    this.x = x;
    this.y = y;
    this.r = r;
  }
  move() {
    this.x = this.x + random(-5, 5);
    this.y = this.y + random(-5, 5);
  }
  show() {
    stroke(255);
    strokeWeight(1);
    fill(15, 94, 156);
    ellipse(this.x, this.y, this.r);
  }
}

```

---

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [January 15, 2021, 6:13pm UTC](https://discourse.processing.org/t/issue-hi-cant-find-the-problem-in-my-code-i-am-new-thanks/27099/2 "2021-01-15T18:13:44Z")

</div>

> <https://github.com/CodingTrain/website/blob/main/beginners/p5js/7.3-array-of-objects/P5/sketch.js>
