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: 
First, you can [`sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) and then [`filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) the elements (separately just for understanding the sort and filter methods):

```js
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}
     ]

 mixedUpAnimals.sort(function(a , b) {
    return a.name > b.name;
});

var softAnimals = mixedUpAnimals.filter(function (el) {
  return el.soft });

var notSoftAnimals = mixedUpAnimals.filter(function (el) {
  return !el.soft });

console.log( softAnimals);
console.log( notSoftAnimals);
```
```
const soft = mixedUpAnimals.filter(animal => animal.soft);
const notSoft = mixedUpAnimals.filter(animal => !animal.soft);

```