write each data into each json files

Viewed 25

hello i'm stuck and i don't know javascript well I would like to write each line of data in a json file with the same name I can't find the syntax

    const data  = [
  '1005002941131619',
  '1005002125918926'
]

const writer = './../scrapers/' + data + ".json";

currently the output gives

1005002941131619,1005002125918926.json

but i would like

1005002941131619.json
1005002125918926.json

i tried data[0,1] but don't work

any idea ?

any idea ?

0 Answers
Related