From 9afd4fd1bd7ea9fb32dd3957c07380d3879da753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=81opusza=C5=84ski?= Date: Wed, 4 Oct 2017 16:15:38 +0200 Subject: [groovy] small fix in iteration over a map --- zh-cn/groovy-cn.html.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'zh-cn') diff --git a/zh-cn/groovy-cn.html.markdown b/zh-cn/groovy-cn.html.markdown index 562a0284..0e7a020c 100644 --- a/zh-cn/groovy-cn.html.markdown +++ b/zh-cn/groovy-cn.html.markdown @@ -219,10 +219,12 @@ for (i in array) { //遍历映射 def map = ['name':'Roberto', 'framework':'Grails', 'language':'Groovy'] -x = 0 +x = "" for ( e in map ) { x += e.value + x += " " } +assert x.equals("Roberto Grails Groovy ") /* 运算符 -- cgit v1.2.3