I have a string, and I need to get its first character.
var x = \'somestring\'; alert(x[0]); //in ie7 returns undefined
How can I fix my co
var string = "Hello World"; console.log(charAt(0));
The charAt(0) is JavaScript method, It will return value based on index, here 0 is the index for first letter.