I am retrofitting my script prototype with your code !
So if I understand, we can use a condition with "return" to return the data passed as argument in the function when the condition is true ?
I never thought we could use the filter method like that !
I would be more familiar with :
array.filter(word => word.toString().indexOf(host) > -1).reverse();
But it doesn't work in JD, so I guess there is no other way to do it as a method.
|