var findMaxConsecutiveOnes = function(nums) {

```
var nowArr=[]
var now=1
for(i=0;i<nums.length;i++){
if(nums[0]==1){
nowArr.push(1);
}
if(nums[0]==0){
nowArr.push(0)
}
if(i>0){
if(nums[i]!== nums[i-1]){
now=1
nowArr.push(now)
}else{
if(nums[i]==1){
now++
nowArr.push(now)
}
}
}
```

}

return Math.max(...nowArr)

};