The page loaded into the browser is represented by a tree of elements, many of whose properties are plain text. Information coming from the server and sent to it is also text. Transferring the center of gravity of processing to the browser makes the site more efficient, reduces the load on the server and gives the latter the opportunity to serve more visitors faster.
The split JavaScript method splits the string into components according to a specific separator and forms an array. The join method joins the elements of an array into a string through a given string. The delimiter can be a character, string, or regular expression.
Split syntax and meaning
JavaScript method format split (string, limit). The first parameter is the delimiter itself. The second parameter is the number of elements to be generated in the output array.
str.split JavaScript, join aStr, ",". ",".
: "d" "e" . - 3. :
. «» (res) (aStr), .
, .
(4) "`" . , , , , .
(4) , JavaScript split , . (5) . , , , , CSS HTML.
, -, - . , .
join & split JavaScript . , .
, . pop() push , , .
, -. : , .
, , .
split JavaScript - . : . , .
- join & split
join & split JavaScript , , , «» .
, , , . .
If instances of created objects are placed in an array, then, using features, for example, of the pop () method, you can work with the array as an object of any type. This method extracts an element from an array, and the next time it retrieves the next one. The sequence of these extracts makes it possible to work with all instances of the array in the same way, without attaching importance to which object is in operation.