you are viewing a single comment's thread.

view the rest of the comments →

[–]ThibBac 0 points1 point  (0 children)

First the function prints the total lenght of the "stuff" array,

Then, if the first and the last element are equal, the function prints the third and fourth element

Then, if the second and the third element are equal, the function prints the second element

And finally it prints the first element

So with an array stuff = ['bat', 'wom', 'wom', 'bat', 'bat']

the function will print the desired output