We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
m
m[key] = elem
key
elem = m[key]
delete(m, key)
elem, ok = m[key]
如果key在m中,ok的值为true,elem为对应map元素类型的值。否则ok为false,elem为对应map元素类型的零值。
ok
true
elem
map
false
Note: 如果elem和ok未定义可以用短标记的形式赋值
elem, ok := m[key]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
m
的元素m
中key
对应的元素m
中删除key
对应的元素key
在m
中是否存在如果
key
在m
中,ok
的值为true
,elem
为对应map
元素类型的值。否则ok
为false
,elem
为对应map
元素类型的零值。Note: 如果
elem
和ok
未定义可以用短标记的形式赋值The text was updated successfully, but these errors were encountered: