Onyekachi Ezeoke
Feb 5 · 1 min read

Thanks for the question, in some cases you might want to use the value you popped from the array but here, it’s just for visual’s sake. So, if it doesn’t fit into your need, don’t bother to return any value. Also, its good practice to adhere to the single responsibility principle where your function does just one thing. So, feel free not to return an Int value from the function 😁. The cited example is for illustration purpose to convey what mutating function is all about in Swift.

    Onyekachi Ezeoke

    Written by

    Software developer at Andela. iOS developer and Cryptography enthusiast. Lifelong learner. Belief: let no one think less of you. If you think you can, you can.

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade