title: Using lodash.groupBy() to normalise objects
body: <p>I have a denormalized array of three different objects - <code>country, school, student</code></p>
  
  <pre><code>const input= 
   [
      {
        countryID: 12,
        country: "US",
        schoolID: 122,
        schoolZone: "Highlands",
        studentID: 142,
        studentName: "Mary"
      },
      {
        countryID: 12,
        country: "US",
        schoolID: 122,
        schoolZone: "Highlands",
        studentID: 145,
        studentName: "John"
      },
      {
        countryID: 14,
        country: "UK",
        schoolID: 222,
        schoolZone: "Leeds",
        studentID: 223,
        studentName: "Peter"
      }
    ];
  </code></pre>
  
  <p>I would like to normalise them like this</p>
  
  <pre><code>const result= 
   [
      {
        countryID: 12,
        country: "US",
        schools: [
          {
            schoolID: 122,
            schoolZone: "Highlands",
            students: [
              {
                studentID: 142,
                studentName: "Mary"
              },
              {
                studentID: 145,
                studentName: "John"
              }
            ]
          }
        ]
      },
      {
        countryID: 14,
        country: "UK",
        schools: [
          {
            schoolID: 222,
            schoolZone: "Leeds",
            students: [
              {
                studentID: 223,
                studentName: "Peter"
              }
            ]
          }
        ]
      }
    ];
  </code></pre>
  
  <p>I understand <code>lodash</code> and <code>ramda</code> can be used to achieve nested normalisation </p>
  
  <p>But I am new to both libraries.</p>
  
  <p>Could you please help me with an implementation ? Also wondering if currying would be a consideration given there is nesting of <code>schools</code> and <code>students</code></p>