method 1:
JSON.stringify(obj, null, '\t');
This "pretty-prints" your JSON string, using a tab for indentation.
method 2:
If you prefer to use spaces instead of tabs, you could also use a number for the number of spaces you'd like :
JSON.stringify(obj, null, 2);
Reference
BOM is annoying. Especially when I am creating a SQL script file.
This change has wasted my DevOps Colleague a lot of time. I hope this information could help more people.
IMHO, using a tool should be the solution.
- use:
^
(shift + 6)
This moves the cursor to the first non-blank character of the current line.
_
(underscore)
This also moves the cursor to the first non-blank character on the same line the cursor is on.
By the way, the 0
command moves to the absolute start of the line, including any leading whitespace.