0

I have defined objects in js as following

 var newevent = {title: txt, start: new Date(y, m, d, h, mi), end: new Date(y, m, d, h, mi+parseInt(eventtime[itemobj])), allDay: false, editable:eventedit[itemobj], className:eventbg[itemobj]};

My question is, what sense does the following code make?

var evt = [newevent];

1 Answer 1

1

It creates a variable (locally scoped to the function) called 'evt' and assigns an array to it. That array has length 1 and contains a reference to the object assigned to newevent.

As to what sense it makes — none without any context. We don't know why the author thinks it is useful to put it in an array.

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.