Web Tools Table Maker3schools TranslateImage CompressorFavicon Icon GeneratorCrop & Resize Image
Apu
Apu June 03, 2023 › #Function #HowTo

How to pass 2 parameters in a Javascript function

In the example below, I have shown how to pass 2 parameters in a Javascript function.

Pass 2 parameters in a Javascript function
    function myFunction(one, two) {
    alert(one); alert(two);
    }

    myFunction(1,2);
  
Try it Yourself »

If you want to pass 3 parameters in this function, then you can also do that.

Pass 3 parameters in a Javascript function
    function myFunction(one, two, three) {
    alert(one); alert(two);alert(three);
    }

    myFunction(1,2,3);
  
Try it Yourself »
How to pass multiple parameters in a Javascript function
save
listen
AI Answer
Write Your Answer
loading
back
View All