⊗jsPmBsCTC 48 of 504 menu

Conversion to string in JavaScript

Sometimes you need to perform the reverse conversion - from a number to a string. The String function performs this:

let str = String(123); // now there is the string '123' in the variable

Another example:

let num1 = 1; let num2 = 2; alert(String(num1) + String(num2)); // shows '12'

Given two variables with numbers. Add the values of these variables as strings and print the result to the screen.

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