That advise has its merits!
Even though my fave language is JS, learning Java 1st can discipline you about being aware which datatype a variable is holding.
Also Java excels in compiling & debugging, b/c it detects right way if we’re passing a wrong datatype to a function or assigning a wrong datatype to a variable or container.
B/c Java & JS share so much in common, and Processing & p5js share most of their API, anything we learn from either can be easily adapted to the other.
So if you’re having difficulty on debugging and/or still needs to learn about datatypes, try out Processing’s Java Mode 1st.
You can always learn JS, or even Python, later once you’re comfortable w/ Java syntax.