Answers for "javascript stringify line breaks"

0

javascript stringify line breaks

const data = {  
  name: 'foo',
  date: new Date(),
  data: [
    {
      question: 'What is the meaning of '+typeof(any),
      answer: 42
    }
  ]
}

console.log(  
  JSON.stringify(data, null, 2)	// null - no formatter, 2 - spaces per indentation
)
Posted by: Guest on January-10-2021

Code answers related to "javascript stringify line breaks"

Code answers related to "Javascript"

Browse Popular Code Answers by Language