I want to write a function that accesses every n-th element of this concatenated string:
var grid = (
"1 \n" +
"a 2 F C A E A E ! \n" +
"G H 3 E L A T \n" +
"L M N E P U F \n" +
"X Z R P L")
For instance, the number 1 in the first string, the number 2 in the second string etc. Right now, I already don't know how I can access e.g. the second string. I tried
console.log(grid[3])
and
console.log(grid[3][0])
but basically have no idea, how to access the elements of the second, third strings etc. Thanks for reading!