Solved

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

Posted on 2014-01-09
3
336 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

726 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