Formatting a one-line script
You enter
- Action
- format
- Source
- function add(a,b){return a+b}const x=add(1,2);console.log(x)
You get
- Result
- function add(a, b) {\n return a + b;\n}\nconst x = add(1, 2);\nconsole.log(x);\n
Each statement goes on its own line, braces get spaces and two-space indents, and semicolons are added where they were missing. Lines are wrapped at 100 characters.
Run through the tool’s own code.