Please write a js program that defines a list class List, that consists of two members: attribute length (representing the number of elements in the list) and method add (adding elements to the list), where the parameters of the constructor and add method are required to be dynamic.