?//從數(shù)組中將成績(jī)撮出來(lái),然后求和取整,并輸出。? ? var sum=0;? ? for(var i=0;i<score.length;i++){? ? sum+=parseInt(Math.floor(score[i].substring(3)));? ? }這里為什么要用parseint和math。floor啊???直接sum+=score【i】.substring(3)不行嗎?求大神解釋一下
關(guān)于訓(xùn)練題里parseInt和Math.floor的問(wèn)題
Gixgine
2019-06-16 13:39:44