0

I have an array from firestore that I have to put to events of full calendar.

What I want is to display it like this

[
 {
   title: '',
   start:''
 }
]

Not this

[{…}]
0
:
{title: "namee", start: "2018-09-19"}
1
:
{title: "namee", start: "2018-09-19"}
2
:
{title: "STI Night", start: "2018-09-18"}
length
:
3
__proto__
:
Array(0)
1
  • 1
    You have provided no code to show how you are rendering the output, but it looks like the type of output provided by the console.log feature built into the developer tools of a number of browsers. So is your question "How can I edit the source code of my browser to change the way console.log works?" Commented Sep 16, 2018 at 23:03

1 Answer 1

2

You can use the third space parameter of JSON.stringify to pretty print your array. See the docs for JSON.stringify.

const a = [
  {
    title: '',
    start: ''
  }
];

console.log(JSON.stringify(a, null, 2));

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.