JavaScript describe data structure and algorithm