Assert an array reduces to true
问题 In one of the tests, we need to assert that one of the 3 elements is present. Currently we are doing it using the protractor.promise.all() and Array.reduce(): var title = element(by.id("title")), summary = element(by.id("summary")), description = element(by.id("description")); protractor.promise.all([ title.isPresent(), summary.isPresent(), description.isPresent() ]).then(function (arrExists) { expect(arrExists.reduce(function(a,b) { return a || b; })).toBe(true); }); Is there a better way to