I have an array generated by the server:
const videos = ["1767504148", "1827943844", "227040308", "1258959982", "550360757", "31439346", "2125342928", "674399863", "713401082", "1698423836"];
For every item in this array I want to do an action so I have a foreach loop:
videos.foreach(create)
function create(number, id)
{
more code...
However, this gave me an error that the array had to be parsed so I decoded it:
var vi = JSON.parse(videos)
vi.foreach(create)
function create(number, id)
{
more code...
This then gave me this error:
Uncaught SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 11 of the JSON data
How can I fix this?