Contact: aviboots(AT)netvision.net.il
43,976 questions
57,432 answers
573 users
const str = 'typescript programming'; const first = str.charAt(0); console.log(first); const last = str.charAt(str.length - 1); console.log(last); /* run: "t" "g" */
const str = 'typescript programming'; const first = str[0]; console.log(first); const last = str[str.length - 1]; console.log(last); /* run: "t" "g" */