let myArray = [“simon”, “fred”];
console.log(myArray[0])
this will output simon
but I want to output ‘m’ (not the whole name).
what is the syntax?
Thanks
let myArray = [“simon”, “fred”];
console.log(myArray[0])
this will output simon
but I want to output ‘m’ (not the whole name).
what is the syntax?
Thanks
Hi
I am sure that would do it but is there not something like
let myArray = [“simon”, “fred”]
console.log(myArray[0,0]
// 0 refers to 1st item and next zero to the first letter.
I know this doesn’t work but surely its just a comma or something??
Thanks again very much
console.log(myArray[0][2])
LOL.
My face goes a little red.
Thanks
I tried everything but the obvious .
Have a lovely day.
Simon
It’s ok.
My first suggestion added extra steps that weren’t really necessary
But know you now about the split method
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.