Hi, I'm trying to create an array that holds every card in card deck. Instead of manually writing out 52 separate elements, I'm creating 4 identical arrays containing the 13 cards, appending them with their respective suits, and then will append the four arrays into one to have a full deck.
I can't figure out the syntax to append each element in the arrays. Can someone help me?
Could you please edit your question to include your code, as code? Many of readers (including myself ) would gladly edit it and explain what's going on, but don't want to spend time transcribing that screenshot
You need to do the append separate from the assignment or return. Unlike many other languages, Swift doesn’t automatically return the result of mutations like that. Instead, it thinks you want a reference to the append function. Someone else can explain that.