Q:

Write a JavaScript program to create a new string without the first and last character of a given string

0

Write a JavaScript program to create a new string without the first and last character of a given string. 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

function without_first_end(str) {
  return str.substring(1, str.length - 1);
}
console.log(without_first_end('JavaScript'));
console.log(without_first_end('JS'));
console.log(without_first_end('PHP'));

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now