Given a multi-dimensional array containing only primitive data types (strings, booleans, and numbers), write a function that returns whether EACH element within each subarray belongs to the same data type.
for example:
function checkTypes(arr) {
// Code here
}
const multiD1 = [[1,2,3],["a","b","c"],[true, true, true]]
checkTypes(multiD1)