Home > Web Front-end > JS Tutorial > There is an interesting piece of code - javascript realizes multi-line information_javascript skills

There is an interesting piece of code - javascript realizes multi-line information_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 19:09:30
Original
852 people have browsed it

Function.prototype.getMultiLine = function() {
var lines = new String(this);
lines = lines.substring(lines.indexOf("/*") 3, lines.lastIndexOf("*/" ));
return lines;
}

var ffff = function() {
/*
Zhang San went to pour water

Oh my God!
*/
}

document.write(ffff.getMultiLine());



Haha, if you use js to write exp or other text that is needed This is very useful

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template