accessing part of a variable using its index

you can access part of a string variable using its index[1]

Javascript

var my_string = "string";
var first_letter_of_my_string = my_string[0];
console.log(first_letter_of_my_string);

Demo

Welcome

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.

❤👩‍💻🕹