practice-problems/practice03 at master · camposss/practice-problems · GitHub
Skip to content

Latest commit

 

History

History
 
 

Folders and files

One to Multi

Build a function that sorts an array into a multidimensional array grouped by data type

  • Write a function that takes one parameter
    • Parameter 1 - An array of anything
  • The function should output a multidimensional array grouped by data type
  • Example:
    • var myArray = ['hello', 34, true, false, 'goodbye', 56, 12, '25', true];
    • groupArray(myArray);
    • Output - [['hello, 'goodbye', '25'], [34, 56, 12], [true, false, true]]