Q:

Write a JavaScript program to concatenate two strings except their first character

0

 Write a JavaScript program to concatenate two strings except their first character.

All Answers

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

function concatenate(str1, str2) {
  str1 = str1.substring(1, str1.length);
  str2 = str2.substring(1, str2.length);
  return str1 + str2;
}

console.log(concatenate("PHP","JS"));
console.log(concatenate("A","B"));
console.log(concatenate("AA","BB"));

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