showing results for - "javascript stringify line breaks"
Sofiane
20 Oct 2020
1const data = {  
2  name: 'foo',
3  date: new Date(),
4  data: [
5    {
6      question: 'What is the meaning of '+typeof(any),
7      answer: 42
8    }
9  ]
10}
11
12console.log(  
13  JSON.stringify(data, null, 2)	// null - no formatter, 2 - spaces per indentation
14)