Range syntax
This commit is contained in:
parent
97e5c2fd72
commit
c77982c642
@ -1,9 +1,5 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
// Definition of an array
|
for value in -10..10 {
|
||||||
let arr = [4, 8, 15, 16, 23, 42];
|
|
||||||
|
|
||||||
// loop over every element of the array
|
|
||||||
for value in arr {
|
|
||||||
println!("Value: {}", value);
|
println!("Value: {}", value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user