If there are no matching elements, you should get an empty Array:
p page.products_on_wishlist_elements.class
#=> Array
p page.products_on_wishlist_elements
#=> []
Justin
On Wednesday, March 27, 2019 at 8:18:45 AM UTC-4, NaviHan wrote:
>
> Hi Titus
>
> I read a wondeful article about the enumera
Hi Titus
I read a wondeful article about the enumerable methods, Any, All, None &
One.
https://www.rubyguides.com/2018/10/any-all-none-one/
For the particular example in the first post, I used the below code to just
return if wishlist is empty(No buttons are present on the wishlist page)
and
Oops
I thought because in a case where the wishlist is empty (i:e no buttons on
wishlist page) the buttons are undefined.
So thats not the case?
When the page class is loaded all the elements are declared or what?
Thsi si equivalent to doing on irb
a.any?
without declaring a as a = [ ]
irb(mai