Formatting a one-line script
Du skriver inn
- Handling
- format
- Kildekode
- function add(a,b){return a+b}const x=add(1,2);console.log(x)
Du får
- Resultat
- /*! license */\nfunction greet(e){return"Hi "+e}greet("x");
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.
Kjørt med verktøyets egen kode.