Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Predict the output
/
Swift
/
Swift fundamentals
What does this program print?
from Swift fundamentals
Swift 6.3.3
beginner
2 min
What does this program print?
swift
Copy
var
current
=
[
2
,
4
]
let
snapshot
=
current
current.
append
(
6
)
print
(
current
)
print
(
snapshot
)
[2, 4, 6] [2, 4]
[2, 4, 6] [2, 4, 6]
[2, 4] [2, 4]
Check
Copy code
Open in playground
Ask AI about this kata
Report an error
previous kata
Why does Swift not accept text[0] for a String?
Quiz
next kata
Review generated check-in summary
Review AI code
A new version is available
Reload