Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Swift Collections and Control Flow Introduction to Collections Working With Arrays

Jakub Blazewicz
Jakub Blazewicz
429 Points

How is that line ; let descardedValue = arrayOfInts.remove(at: 5) wrong?

I don't understand why this line is wrong

array.swift
// Enter your code below

var arrayOfInts = [1,2,3,4,5,6]

arrayOfInts.append(7)
arrayOfInts += [8]

let value = arrayOfInts[4]

let descardedValue = arrayOfInts.remove(at: 5)

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,704 Points

Hi Jakub,

You're syntax is spot on. :thumbsup:

However, you have a small spelling error for the final variable name. Challenges are extremely picky and, yes, even something like a spelling error will cause the task to get the Bummer.

You have descardedValue with an 'e' instead of an 'i' discardedValue. Once that's fixed up, it all passes!

Nice work! :) :dizzy: