我用javascript (React.j)编写了以下函数,它使用for循环: var matches = this.state.matchesi in matches){ var result = player_team + " vs.away_team_id == playerTeamId){
var results =
例如,如果我有一个for循环,并且我想使用像Math.round()这样的方法对这个数字进行舍入,但是我只需要对这个数字进行一次舍入(即这个数字在整个循环中不会改变),那么将其存储到一个变量中,然后在条件中使用该变量是否更好for (int i = 0;i < Math.Round(x);i++) //Some code vs
for (int i = 0,roundedX = Math.Round