Contact: aviboots(AT)netvision.net.il
40,891 questions
53,305 answers
573 users
const str = 'javascript'; const first = str.charAt(0); console.log(first); const last = str.charAt(str.length - 1); console.log(last); /* run: "j" "t" */
const str = 'javascript'; const first = str[0]; console.log(first); const last = str[str.length - 1]; console.log(last); /* run: "j" "t" */