Home > Web Front-end > JS Tutorial > Concat method instance of JavaScript string object (used to concatenate two or more strings)_Basic knowledge

Concat method instance of JavaScript string object (used to concatenate two or more strings)_Basic knowledge

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 16:33:42
Original
1636 people have browsed it

JavaScript concat method

The

concat method connects two or more strings, its syntax is as follows:

Copy code The code is as follows:

str_object.concat(str1, str2, ...)

str_object is the first string (object) that needs to be connected, str1 is the second string that needs to be connected, str2 is the third string that needs to be connected, and so on, at least one str1 is required.

concat instance

Copy code The code is as follows:


Run this example, output:
www.jb51.net
Tip: It is usually more convenient to use the algorithm to connect strings. For details, see: "JavaScript Operators".

Related labels:
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
Latest Issues
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template