Solved

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

Posted on 2014-01-09
3
332 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 43

Assisted Solution

by:Rob
Rob 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

856 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