Use self commenting code with readable variable names that explain what the variables and functions do. Also format it for humans to read and maintain. Never reassign, wrap or monkey-patch functions at runtime. Edit the original functions directly. Static structure stays in the HTML. JS only generates data-dependent content. This must work for browsers that are likely to be in use by viewers with old equipment especially old mobile phones - but does not need to be supported for museum pieces or browsers too old to display the content at all. The files must stay self-contained. Use try/catch around each stage's render call, log with console.warn, and show a simpler version where one exists. Target browsers: iOS 12 / Safari 12 (iPhone 5s and 6) Android 5+ with Chrome 70 or newer Not supported: iOS 11 and earlier, Android 4.x, Internet Explorer Syntax: Add and retain polyfills near the head of the script for any older browsers. If you find any optional chaining (?.) and nullish coalescing (??) rewrite it by hand as explicit checks. Don't use any other syntax Safari 12 can't parse. If an SVG feature is missing (vector-effect, clipPath, getBBox, etc.), use a plain default rather than throwing. Don't rebuild the features, just degrade. The page must never be blank on a target browser. Add comments of the kind an experienced JavaScript developer would write. They're for me and for any other developers to look at the code. I find they also help chatbots. It's okay if a significant percentage of the code consists of comments. We are not trying to minimize it as it is likely to be small in total code size. A short note above each function covering what it does, its inputs and outputs, and any side effects. Inline comments on anything non-obvious. Comments explain why, not just what. Don't comment the obvious. Checks before delivery JS syntax check, and a check that no ?. or ?? remains. No innerHTML with data values entered by the user. Make sure the code is safe for any values entered by the user as text - that any tags are either inserted as plain text or converted to html entities > and < Target browsers include: iOS 12 / Safari 12 Android 5+ with Chrome 70+ not iOS 11-, Android 4.x, or IE no ?. no ?? no unsupported Safari 12 syntax Professional standard render-stage failure handling that gives useful feedback immediately if something goes wrong via the browser console.