Sum of each element raised to ( prime | Function to return the required sum ; Driver code
function getSum ( arr , p ) { return arr . length ; } let arr = [ 5 , 6 , 8 ] ; let p = 7 ; document . write ( getSum ( arr , p ) ) ;