You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8 lines
310 B
8 lines
310 B
5 years ago
|
// charCodeAt(): Takes index and it returns char code(ASCII number) of the value at that index
|
||
|
|
||
|
string.charCodeAt(index)
|
||
|
let string = '30 Days Of JavaScript'
|
||
|
console.log(string.charCodeAt(3)) // D ASCII number is 51
|
||
|
let lastIndex = string.length - 1
|
||
|
console.log(string.charCodeAt(lastIndex)) // t ASCII is 116
|