Advertisement
Guest User

Untitled

a guest
Sep 26th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const nestedArray = [[1, 2, 1, 24], [8, 11, 9, 4], [7, 0, 7, 27], [7, 4, 28, 14], [3, 10, 26, 7]];
  2.  
  3. const getArrayElementsByRows = array => {
  4.   for (element in array) {
  5.     console.log(`row ${element}\n${array[element].join('\n')}`);
  6.  
  7.   }
  8. }
  9.  
  10. console.log(getArrayElementsByRows(nestedArray));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement