Question: am writing a program in java on Linked List. I get an error when i use toString to return the IP address and PC of the code below.

```
package linked;

import java.net.InetAddress;

public class Work {
    private InetAddress IP;
    private String PC;

    public Work(InetAddress IP, String PC){
        this.IP=IP;
        this.PC=PC;
    } 
    public InetAddress getIP(){
        return IP;
    }
    public String getPC(){
        return PC;
    }
    @Override
    public String toString() {
        return IP + ' ' + PC;
    }
}

```

It comes up with an error in the `@Override` that says 

> 
> bad operand types for binary operator '+' first type: InetAddress  
> 
>  second type: char
> 
> 
>

Answer: 
```
// Get current time
const now = Date.now();
const futureDates = dates.filter(date => {
  // Filter out dates in the past or falsey values
  return date && (new Date(date)).getTime() > now;
});

// Do something with the result
console.log(futureDates.length);

```
Use [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) like below if don't consider the situations like time zone, invalid date string etc:

```js
const test = [
  "2018-04-02T15:15",
  "2018-04-07T14:20",
  "2018-04-28T11:50",
  null,
  null,
  null,
  null,
  "2018-05-30T17:45",
  "2018-04-07T16:20"
]
const currentWhenCalc = new Date()
result = test.filter(function(item){
  return item && new Date(item) > currentWhenCalc
})
console.log('data', result, 'count', result.length)
```