Jump to content

Filter items that have common properties in JS


silvercover

Recommended Posts

I have wizard that asks several predefined questions to find-out user needs. at the end it must offer some items based on user answers. all of available items have some properties in common and one or two specific properties. what is the best way or algorithm to do this in JavaScript?

e.g:

Item 1 Properties:
 

  •     Name
  •     Weight
  •     Color
  •     Size

Item 2 Properties:



  •     Name
  •     Size
  •     Weight


Item 3 Properties:



  •     Name
  •     Color
  •     Size

Thanks.
 

 

How are you saving/associating the properties to the objects? If this is data that is stored in the Database, then AJAX may be a better solution rather than putting logic on the client side.

 

But, you haven't provided any details (i.e. code) to what you have now, so I can't provide any possible solutions.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.