Why is this function printing out an array of [83 83 83 83 83]
instead of [98 93 77 82 83]
?
package main
import "fmt"
func main() {
var x [5]float64
scores := [5]float64{ 98, 93, 77, 82, 83, }
for i, _ := range x {
for j, _ := range scores {
// fill up x array with elements of scores array
x[i] = scores[j]
}
}
fmt.Println(x)
}