Solved

multidimensional array

Posted on 2016-10-04
4
26 Views
Last Modified: 2016-10-04
I have an array like so

var items = [
  [1, 2],
  [3, 4],
  [5, 6]
];

Open in new window


How can I insert [7,8]?

The following is way off
items.push(7,8);

I have a SharePoint list and I am trying to add the SharePoint list item id and a corresponding date in a multidimensional array.
I want to later update the date and use the id to update the right item.

Any help would be appreciated.

Thanks!
0
Comment
Question by:Isaac
  • 2
4 Comments
 
LVL 49

Accepted Solution

by:
Ryan Chong earned 500 total points
Comment Utility
tried:
items.push([7, 8]);

Open in new window

?
0
 
LVL 22

Expert Comment

by:Mrunal
Comment Utility
hi
you can try below code:

var items = [
  [1, 2],
  [3, 4],
  [5, 6]
];
var NewArray = ['7', '8'];
items.push(NewArray);

Open in new window

0
 
LVL 5

Author Comment

by:Isaac
Comment Utility
That stores it as a string and not a number.
0
 
LVL 5

Author Closing Comment

by:Isaac
Comment Utility
THanks!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now