Question: struggling with how to write a function that sorts this array properly into two separate arrays. I can't figure out where to go from here, I know i need to probably use the sort method but I don't know how to write it properly, I've only been working with JS for a couple weeks.

```
    let mixedUpAnimals = [
     {name: 'chinchilla', soft: true},
     {name: 'armadillo', soft: false},
     {name: 'bear', soft: true},
     {name: 'porcupine', soft: false},
     {name: 'hedgehog', soft: false},
     {name: 'honey badger', soft: false},
     {name: 'mouse', soft: true}
     ]
     for(var i = 0; i < mixedUpAnimals.length; i++){
     if (mixedUpAnimals[i].soft === true);

```

Answer: 
```
const soft = mixedUpAnimals.filter(animal => animal.soft);
const notSoft = mixedUpAnimals.filter(animal => !animal.soft);

```
You can use the [sort()](https://www.w3schools.com/jsref/jsref_sort.asp) method

```js
const mixedUpAnimals = [
  {name: 'chinchilla', soft: true},
  {name: 'armadillo', soft: false},
  {name: 'bear', soft: true},
  {name: 'porcupine', soft: false},
  {name: 'hedgehog', soft: false},
  {name: 'honey badger', soft: false},
  {name: 'mouse', soft: true}
];

const sortedAnimals = mixedUpAnimals.sort((a, b) => (a.soft < b.soft) ? 1 : -1);

console.log(sortedAnimals);
```

This way the animals with `soft: true` will be at top. If you need to reverse the order, simply reverse the `<` sign.