Question: I'm trying to select dates bigger than in javascript function. My function return empty array and I don't know wher I'm doing mistake

```
var arr = ["2018-01-24T17:43:03.000Z","2018-01-25T17:43:03.000Z","2018-01-
26T17:43:03.000Z","2018-01-27T17:43:03.000Z"]
var biggerThanElements = arr.filter(x=>{
  x = new Date(x);
  element = new Date("2018-01-23T00:00:00.000Z");
  x > element
});

```

console.log(biggerThanElements)

Answer: 
You could just compare directly with [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) dates/time strings.

```js
var arr = ["2018-01-24T17:43:03.000Z", "2018-01-25T17:43:03.000Z", "2018-01-26T17:43:03.000Z", "2018-01-27T17:43:03.000Z"],
    biggerThanElements = arr.filter(x => x > "2018-01-23T00:00:00.000Z");

console.log(biggerThanElements);
```
There are a few issues in your code:

1. You need to return the result `return x > element`.
2. You use the date `2018-01-23` and all your dates are "bigger".
3. It is highly recommended to declare all your variables (i.e. `element`).

Try this:

```js
var arr = ["2018-01-24T17:43:03.000Z", "2018-01-25T17:43:03.000Z", "2018-01-26T17:43:03.000Z", "2018-01-27T17:43:03.000Z"]
var biggerThanElements = arr.filter(x => {
  x = new Date(x);
  var element = new Date("2018-01-25T00:00:00.000Z");
  return x > element
});
console.log(biggerThanElements);
```