Home >Web Front-end >JS Tutorial >How to splice a large number of strings in Javascript_javascript skills
There are heredoc string definition methods in php and python:
php:
Splicing method one:
alert(str);
Give me a solution:
function hereDoc(func) {
return func.toString().split(/n/).slice(1, -1).join('n');
}
console.log(hereDoc(aHereDoc));