computer






 

Question by  mymimikitty (15)

What is the default parameter for javascript?

I need the default parameter for javascript.

 
+11

Answer by  Sting1 (686)

To set a default parameter: function Foo(param1, param2) { if(param2 == null) param2 = "default" } or function Foo(param1, param2) { param2 = param2 || "default" }

 
You have 50 words left!