var str = nums.join("").split("0").map(function(value){
return value.length;
});
return Math.max.apply(null, str);
Javascript Solution

I did the same solution, without the apply, and making sure we return 0 if there is no 1s in the binary array, and I'm faster than 93% of the solutions:
var findMaxConsecutiveOnes = function(nums) { const lengths = nums.join('').split('0').map(group => group.length) return Math.max(0, ...lengths) };