⊗jsPmFBSP 203 of 504 menu

Multiple function parameters in JavaScript

A function can take not single parameter, but several. In this case, they must be listed separated by commas. For example, let's make a function that takes two numbers as parameters and prints their sum to the console:

function func(num1, num2) { console.log(num1 + num2); }

Let's test our function:

func(1, 2); // shows 3

Make a function that takes 3 numbers as parameters and prints the sum of these numbers to the console.

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