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
/
Quiz
/
Go
/
Slices
Which statement about var items []string and items := []string{} is correct?
from Slices
Go 1.27
beginner
1 min
Which statement about var items []string and items := []string{} is correct?
Both compare equal to nil.
Both have length zero and accept append, but their default JSON encodings differ.
Only the empty literal can be ranged over.
The nil slice cannot be passed to copy.
Check
Ask AI about this kata
Report an error
previous kata
What independence does slices.Clone provide for a [][]byte value?
Quiz
next kata
What does this program print?
Predict the output
A new version is available
Reload