In javascript you can break lines: - After a dot (e.g. `methodName.`) - After commas in argument lists - After logical operators (`&&`, `||`) - After `+`, `-`, etc.
But you **should not** break: * Between `return` and its returned value without wrapping in parentheses * In the middle of a variable name or string literal * In a way that causes [Automatic Semicolon Insertion (ASI)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#automatic_semicolon_insertion) to insert unwanted semicolons
# Recommended Formatting for Documentation Here’s a clean Miller-column-friendly version of your block:
let data = ""; // Parse HTML for <a> tag first if (e.dataTransfer.types.includes("text/html")) { const html = e.dataTransfer.getData("text/html"); const doc = new DOMParser(). parseFromString(html, "text/html"); const anchor = doc.querySelector("a[href]"); if (anchor) { data = anchor.href; } }
It’s slightly unusual in production code, but totally legit and excellent for documentation or side-by-side panels.
# See