2017-01-24 3 views
0

JSONファイルに格納されたこの配列をループしようとしています。私は引用符が保存されているかどうかを確認して、それが保存されているかどうかに応じて表示する必要があります。配列をループして引用符を表示する

_toggleCheck() { 
      var checked = !this.state.checked; 
      this.setState({ checked: checked }); 
      // For loop to run through arrray and update booleans 
      for(int i = 0; i<quotesArray.length-1; i++;){  
       quotes.quotesArray[i].isSaved = checked; 
      } 
      this.props.onChange && this.props.onChange(this.props.name, checked); 

    } 

私はこのエラーに遭遇し、解決できません。 63行目はforループの始まりです。私はどのようにネイティブの反応とライン上の任意のチュートリアルを見つけることができないためにforループを使用するか分からない。ところで

enter image description here

+0

ご質問はありますか? @Maxwelll編集中 – Maxwelll

+0

ごめんなさい – user2026178

答えて

1
for(int i = 0; i<quotesArray.length-1; i++;){ 
             ^remove this semicolon 

、あなたはi < quotesArray.length - 1代わりのi < quotesArray.lengthてもよろしいですか? -1を追加すると、最後の要素はスキップされます。

関連する問題