JavaScript program to find the maximum sum such that no three are consecutive using recursion .
let arr = [ 100 , 1000 , 100 , 1000 , 1 ] ; let sum = new Array ( 10000 ) ; for ( let i = 0 ; i < 10000 ; i ++ ) { sum [ i ] = - 1 ; }