This is script in python. I want to achieve the same goal with Javascript. So the script is that
my_list = [18, 19, 20, 27, 28, 29, 38, 39, 40]
new_list = list(filter(lambda x: x + 10 in my_list or x - 10 in my_list, my_list))
What is equivalent of list(), filter(), lambda in this situation to convert Python to Javasript ?