感觉这个Map有点像php的关联数组。 又感觉JS的数组就是类似PHP的索引数组。JS:a.js[0] php: $php[0] 这样的来取。 而php的关联数组就是$a = array("alex"=>34,"ken"=>23,"ben"=>55) 有点像js的var b = new Map([['alex',34],['ken',23],['ben',55]]) 这样。 只不过php取值是 $a['alex'] 这样就可以取到34 而JS就 b.get('alex') 这样取到34.
Sign in to make a reply
Alex__XD
感觉这个Map有点像php的关联数组。 又感觉JS的数组就是类似PHP的索引数组。JS:a.js[0] php: $php[0] 这样的来取。 而php的关联数组就是$a = array("alex"=>34,"ken"=>23,"ben"=>55) 有点像js的var b = new Map([['alex',34],['ken',23],['ben',55]]) 这样。 只不过php取值是 $a['alex'] 这样就可以取到34 而JS就 b.get('alex') 这样取到34.