Tetrahedral Numbers | Function to find Tetrahedral Number ; Driver code
function tetrahedralNumber ( n ) { return ( n * ( n + 1 ) * ( n + 2 ) ) / 6 ; } let n = 5 ; document . write ( tetrahedralNumber ( n ) ) ;