⊗jsPmSMSP 195 of 504 menu

Splitting Strings in JavaScript

split join

Given the string '1-2-3-4-5'. Use the split method to write each number in this string into a separate array element.

Given the string '12345'. Use the split method to write each character of this string into a separate array element.

Given the following array:

let arr = [1, 2, 3, 4, 5];

Use the join method to merge it into the string '1-2-3-4-5'.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline