@ -1,5 +1,5 @@
// charAt(): Takes index and it returns the value at that index
string.charAt(index)
// string.charAt(index)
let string = '30 Days Of JavaScript'
console.log(string.charAt(0)) // 3
let lastIndex = string.length - 1
@ -1,6 +1,6 @@
// charCodeAt(): Takes index and it returns char code(ASCII number) of the value at that index
string.charCodeAt(index)
// string.charCodeAt(index)
console.log(string.charCodeAt(3)) // D ASCII number is 51
// indexOf(): Takes takes a substring and if the substring exists in a string it returns the first position of the substring if does not exist it returns -1
string.indexOf(substring)
// string.indexOf(substring)
console.log(string.indexOf('D')) // 3
console.log(string.indexOf('Days')) // 3