August 2021
Beginner
112 pages
1h 23m
English
| Puzzle 2 | Empty-Handed |
| | package main |
| | |
| | import ( |
| | "fmt" |
| | ) |
| | |
| | func main() { |
| | var m map[string]int |
| | fmt.Println(m["errors"]) |
| | } |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
This code will print: 0
The zero value for an uninitialized map is nil. Some operations on Go’s map type are nil safe, meaning they will work with a nil map without panicking.
Both len and accessing a value ...
Read now
Unlock full access