JavaScript implementation to count triplets in a sorted doubly linked list whose product is equal to a given value ' x '
class Node { constructor ( data ) { this . data = data ; this . next = this . prev = null ; } }