var string = "Hello, World!";
console.log( string.charAt(4) ); // "o"
/* making a function that returns the index of the specific character in
Javascript */
function myFunction(x, y) {
let myString = x;
let myIndex = y;
return myString.charAt(myIndex);
}
console.log(myFunction("Hey Coders, I am Rehman", 5)); // Output would be "o"
console.log(myFunction("Hey Coders, I am Coder", 0)); // Output would be "H"
var string = "Hello, World!";
console.log( string[4] ); // "o"