doc : array slicing examples (#7069)

pull/7080/head
Andréas Livet 2020-12-02 04:06:43 +01:00 committed by GitHub
parent dedb8f7e41
commit ff26f0539c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -521,6 +521,8 @@ println(nums[1]) // "2"
nums[1] = 5
println(nums) // "[1, 5, 3]"
println(nums[0..2]) // slicing gives an array "[1, 5]"
println(nums.len) // "3"
nums = [] // The array is now empty
println(nums.len) // "0"