≈ the.bay.news

Updating array slices doesn't show error/warning in the editor

Swift Forums
Updating array slices doesn't show error/warning in the editor
Hi Team, I was playing with arrays and its slices. I noticed that the editor doesn't show the error or warning if I'm trying to update/insert an element in the slice. My thinking is that as the slice sliceNames is declared as var its elements should be editable. If it's not editable then IDE/VScode should show an error/warning even before we compile. Please let me know if I'm missing anything here. let names = ["Alice", "Bob", "Charlie", "David", "Eve"] var sliceNames = names[1...3] // The b...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.