<script type="text/javascript">
str='Hello World'
document.writeln(str.charAt(3)); // l
document.writeln("<br>"+str.charAt(4)); // o
document.writeln("<br>"+str.charAt(5)); // Empty space
document.writeln("<br>"+str.charAt(6)); // W
document.writeln("<br>"+str.charAt(20)); // Empty string
document.writeln("<br>"+str.charAt(-2)); // Empty string
</script>
charAt(): This function takes input number of the location and returns the particular character at that location.
var my_str="Welcome to www.plus2net.com"
document.write(my_str.charAt(3))
The output of above code is c