Hi Illia Kovalov thanks so much for your reply, I have certainly planned to continue this series but unfortunately found the time to do so. Maybe I shall look to continue in the next few months.
You are absolutely right in pointing out the function in question is pure by the definition you have provided, but as I am sure you’ll agree, the mutable state within the method should be removed when possible. That was the aim of that explanation, but maybe the use of ‘pure’ was ambiguous and confusing. Thanks for making me aware of that.
Also thank you for the removeAt(index)
tip, for now, I shall leave my original in place but will certainly update my codebase in time to reflect this.
Many thanks for leaving a comment, please do share this if it was of use to you!
Ed