Solved

How to create javascript class and store input values in memory?

Posted on 2014-01-09
3
323 Views
Last Modified: 2014-01-16
How can I create a class Person, with the fields firstname, lastname, age and zipcode. I need to store a large collection of these Person objects in memory. I need to be able to add and delete items, in addition to being able to sort and search by any of the fields.  How can use  Javascript to demonstrate how you would accomplish this.
Can you please describe a memory and performance efficient data structure and mechanism to accomplish this.
0
Comment
Question by:RajG1978
3 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39769797
This sounds like homework and we are not allowed to answer these types of questions.  If you can present us with some code we can help point you in the right direction.
0
 
LVL 9

Accepted Solution

by:
Sar1973 earned 250 total points
ID: 39770656
You could create an array with 4 columns/fields, and use the push and the remove methods to add and delete items. See http://www.w3schools.com/js/js_obj_array.asp
0
 
LVL 42

Assisted Solution

by:Rob Jurd, EE MVE
Rob Jurd, EE MVE earned 250 total points
ID: 39773156
Please have a read of this article http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_12264-Javascript-Frameworks-what-are-they.html
It outlines a basic framework but also the basics of class creation and instantiation
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Find out what you should include to make the best professional email signature for your organization.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

920 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

16 Experts available now in Live!

Get 1:1 Help Now