I am working on store procedures in snowflake using javascript language.
There I encounter a string having all column names as per my requirement. But the problem is that this string contains a duplicate of these column names like 5-10 times. Now I want to remove these duplicate column names from the string. Or say I want the string to be unique with all column names one time.
My string
var result = "name,id,product,date,name,id,product,date,name,id,product,date,name,id,product,date,name,id,product,date"
Required output string
var result = "name,id,product,date"
How can I achieve this in Javascript?
Note:- I have never worked on javascript before