Hi everyone! I'm the author of code.mu :)
I'd love to chat with my non-Russian audience. I'm looking for your feedback on the site and the translation quality. Let's chat:)
⊗jsPmBsStr 28 of 504 menu
◀ ▶

Strings in JavaScript

As we mentioned previously, data can be of various types. One of the types is numbers, we have already studied it a little. Let's now move on to strings.

Strings are created using quotes:

let str = 'abc'; alert(str); // shows 'abc'

Quotes can be either single or double:

let str = "abc"; alert(str); // shows 'abc'

There is no difference between single and double quotes in JavaScript. Their use depends on your preferences. I prefer to use single quotes, so they will be used throughout the rest of the tutorial.

Hereinafter, if the output result is a string, then I quote it to show that it is a string, such a way: shows 'abc'. No quotes will appear when you output a string with alert (that is, what I have written inside the quotes will be displayed on the screen).

Create the string with your first name and one with your last name. Display this information on 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