Given a nested array write a function that returns the total length of the nested subarrays.
CODE TEMPLATE
function totalLength(arr){
// write your code here
}
let myArray = [[1,2,3],[],[false,'vivek'],[]];
totalLength(myArray);//5
myArray = [[1],[],[false,'vivek'],[5,6,7,8,9]];
totalLength(myArray);//8
myArray = [];
totalLength(myArray);//0