⊗jsPmBsFr 22 of 504 menu

Fractions in JavaScript

In JavaScript, you can work with decimals. In doing so, the integer and fractional parts are separated from each other by a dot. See an example:

let a = 0.5; alert(a); // shows 0.5

See another example:

let a = 0.5 + 0.5; alert(a); // shows 1

Write the number 1.5 into the variable a and the number 0.75 into the variable b. Find the sum of the values of these variables and display it 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