Check out Daniel Shiffman's "The Nature of Code" [1]. You can read it online for free (and play around with the web-based examples!). The book uses Processing but there's a p5.js port of the book available on Dan's Github [2].
__
[2]: https://github.com/shiffman/The-Nature-of-Code-Examples-p5.j...