Improve the JavaScript extensions docs.
Review Request #13018 — Created May 9, 2023 and submitted — Latest diff uploaded
This improves the JavaScript extensions docs, mostly by modernizing the
JavaScript code in the examples and fixing up some typos.
Built the docs.