Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Example:

http://jsfiddle.net/7Cwbn/60/

I'm trying to use array_diff function from PHPJS to check if all of the elements inside selectedFeatures are found inside elem.features, but instead I receive undefined. What gives?

$(markers.houses).each(function(index, elem) {
        //first filter by selected features
        console.log(array_diff(elem.features, selectedFeatures).length);
        if (array_diff(selectedFeatures, elem.features).length == 0) {
            if (!markers.houseMarkers[index].visible) {
                markers.houseMarkers[index].setVisible(true);
            }
        }
    });
share|improve this question

1 Answer 1

up vote 1 down vote accepted

Solution:

Inside array_diff() definition change the retVal to equal [] instead of {}.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.