JavaScript program to check if a string starts and ends with certain characters:
let str = "Hello World!";
let startsWith = "Hello";
let endsWith = "!";
console.log(str.startsWith(startsWith));
console.log(str.endsWith(endsWith));
JavaScript program to check if a string starts and ends with certain characters:
let str = "Hello World!";
let startsWith = "Hello";
let endsWith = "!";
console.log(str.startsWith(startsWith));
console.log(str.endsWith(endsWith));