Hi bodomo welcome to the forum.
I have a similar background and I have been learning and using JS seriously for almost 2 years now.
One of the problems with example code (even well written code) is that it might demonstrate some useful JS feature but does not discuss it in any detail. For instance the syntax of a many JS features for example, OO (object orientation), closures, methods, are all large and complex topics that even tutorial sites fall to cover in depth.
Different people have different learning preferences but my approach has always been to write code and then look at examples and reference material when I got stuck or if something didn’t work.
So 2 years ago I decided to learn p5js and JavaScript. After getting used to the code structure for p5js sketches e.g. preload
, setup
, draw
and writing simple 2D and 3D sketches I practiced by converting some of my Java sketches to use p5js. You can see some of my sketches here (most require keyboard and mouse so not suitable for touchscreen devices). BTW my favourite is Rebellion on Pern being the most complex p5js sketch I have created
Once I was comfortable with p5js I decided to create canvasGUI, a p5js library that provides on canvas GUI controls e…g. buttons, checkboxes, sliders etc. This library is freely available for others to use and more info can be found here and on github.
I could never have got this far so quickly by simply examining sample code and tutorial websites, it was by writing code, more code and even more code - learning by repetition. Some of the techniques I used required a broad and deep understanding of JavaScript not easily found on the web so I have a secret to share…
My secret is something from the dark ages - a book yes that’s right a book, not just any book but
“JavaScript The Definitive Guide” Seventh Edition by David Flannagan
I cannot recommend this book highly enough, I always keep it beside me when I am programming. I still research particular topics on the web but then use this book as reference when I come to implement them.
I know I have rambled on a bit but I hope you find my JavaScript journey interesting. If you decide to get this book make sure it is the seventh edition and not an earlier one.