title: Getting the lowest number in object first
body: <p>I'm looping over an object thats a list of terms for a student. The structure for my data looks like this:</p>
  <pre><code> terms: {
    term-termId1: {
     classData: { //some class data here that im not going to list },
     class2   : { //some class data here that im not going to list },
     class3   : { //some class data here that im not going to list },
     termName: 'Spring 2018',
     gradeLevel: 9,
    },
    term-termId2: {
     classData: { //some class data here that im not going to list },
     termName: 'Summer 2018',
     gradeLevel: 9,
    },
    term-termId3: {
     classData: { //some class data here that im not going to list },
     class2   : { //some class data here that im not going to list },
     termName: 'Summer 2020',
     gradeLevel: 12,
    },
    term-termId4: {
     classData: { //some class data here that im not going to list },
     termName: 'Summer 2019',
     gradeLevel: 11,
    },
    term-termId5: {
     classData: { //some class data here that im not going to list },
     termName: 'Summer 2019',
     gradeLevel: 10,
    },
    term-termId6: {
     classData: { //some class data here that im not going to list },
     termName: 'Winter 2018',
     gradeLevel: 9,
    },
   }
  </code></pre>
  <p>Thats all the data I'll give, the entries are scattered.</p>
  <p>I'm trying to get the lowest gradeLevel entries first so I can pass them to a function that creates table components. So for example, I want all the gradeLevel: 9 s first, then 10s, then 11s then 12s.</p>
  <p>I just want to know a good way to do this. I can think of a few ways, like writing some if statements in the loop, but im sure it can be done a better way.</p>
  <p>Currently I'm starting out like this:</p>
  <pre><code>    for (single in terms) {
        for (term in terms[single]) {
          const classes = terms[single]
          console.log(classes[term])
        }
      }
  </code></pre>
  <p>I know that loop dosn't match the data I gave, thats just how i'm getting the data on my computer. I just gave an example.</p>
  <p>Anyway, it would be great if I could get some help figuring out the best way to get the lowest gradeLevel entries first.</p>