Question

I was wondering if I do something like this in AngularJS,

var myCat = cats.filter(function(comparedCat) {
    if(comparedCat.parentCategory != undefined) {
        return cat.id === comparedCat.parentCategory.id;
    }
});

and it returns a list of objects

[Object, Object, ...]

Are these objects referenced to the the objects in cats? In other words, if I change the subset of cats (returned array of objects), will it change the objects in cats?

Was it helpful?

Solution

So I found out the myCat objects are actually references to objects in cats. That is so cool you can just change the objects returned to be reflected on the original objects.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top