A

Admin • 670.22K Points
Coach

Q. What will this code print?

Code:
let numbers = [1, 2, 3, 4, 5]
print(numbers.dropFirst(2))
  • (A) [1, 2, 3, 4, 5]
  • (B) [3, 4, 5]
  • (C) [1, 2]
  • (D) [2, 3, 4, 5]
  • Correct Answer - Option(B)
  • Views: 1
  • Filed under category Swift (iOs)
  • Hashtags:

Explanation by: Admin
`dropFirst(2)` drops the first two elements from the array.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.