.removeFirst()

Christine_Yang267 total contributions
Published Oct 11, 2022
Contribute to Docs
The .removeFirst()
method removes the first element in an array.
Syntax
arrayName.removeFirst()
Example
var topBabyNames = ["Sophia", "Liam", "Riley", "Jackson", "Olivia", "Noah"]topBabyNames.removeFirst()print(topBabyNames)
This will output:
["Liam", "Riley", "Jackson", "Olivia", "Noah"]
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.