# Processing to P5.js

**URL:** <https://discourse.processing.org/t/processing-to-p5-js/39545>\
**Category:** Coding Questions\
**Created:** [November 2, 2022, 5:21am UTC](https://discourse.processing.org/t/processing-to-p5-js/39545 "2022-11-02T05:21:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sosophia10](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@sosophia10](https://discourse.processing.org/u/sosophia10)\
**Post date:** [November 2, 2022, 5:21am UTC](https://discourse.processing.org/t/processing-to-p5-js/39545/1 "2022-11-02T05:21:45Z")

</div>

I am trying to convert my Processing project to P5.js, however I’ve run into a bunch of errors with an object not being defined and “unexpected identifiers”. The original Processing code works fine.

Would someone please diagnose my JavaScript syntax? I’ve shared both project versions.

**P5.js:**

> **[p5.js Web Editor](https://editor.p5js.org/sosophia10/sketches/7GMy8Mq1U)**
>
> A web editor for p5.js, a JavaScript library with the goal of making coding accessible to artists, designers, educators, and beginners.

**Processing4:**

> **[p5.js Web Editor](https://editor.p5js.org/sosophia10/sketches/N7-nMlvM8)**
>
> A web editor for p5.js, a JavaScript library with the goal of making coding accessible to artists, designers, educators, and beginners.

---

<div class="post-metadata">

**Author:** ![javagar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/javagar/32/11434_2.png) [@javagar](https://discourse.processing.org/u/javagar)\
**Post date:** [November 2, 2022, 7:00am UTC](https://discourse.processing.org/t/processing-to-p5-js/39545/2 "2022-11-02T07:00:50Z")

</div>

In the p5.js code, what is this that you have within the parentheses of line 24 of ball.js?:

```auto
  checkPaddle(Paddle paddle) {

```

While in Java, you need to declare the types of the parameters in a function or method definition, that should not be done in p5.js.
