These are chat archives for angular/angular-2-ionic-2

7th
Nov 2017
Dave Vaughan
@rbnzdave
Nov 07 2017 04:54
dont see why not
Alexandre R.
@Talents_finder_twitter
Nov 07 2017 21:54
HI !

I'm stuck with a indexOf for a multidimensional array
I have this :
array =
{member: "place_1509136116761", H0709: true, H0911: true, H1113: true, H1315: true}
{member: "place_1509136116773", H0709: false, H0911: false, H1113: false, H1315: false}
{member: "place_1509136116699", H0709: true, H0911: true, H1113: true, H1315: true}
{member: "place_1509136116734", H0709: true, H0911: true, H1113: true, H1315: true}

I need a function to define if "H0911" is true for at least one member.
How can I do that ?

Dave Vaughan
@rbnzdave
Nov 07 2017 22:14
length of a filtered array
myArray.filter(a => a.H0911).length
Alexandre R.
@Talents_finder_twitter
Nov 07 2017 22:30
Really ?
Let me check.
But what is "a" ?
Alexandre R.
@Talents_finder_twitter
Nov 07 2017 22:38
@rbnzdave OHHHHH YESSSSSSSS
IT WORKS !!!!
Thanks !!!
Dave Vaughan
@rbnzdave
Nov 07 2017 23:31
a is just the element in the array for each pass of the function