/ Published in: JavaScript
This sets b to 3 if b isn\'t passed. So all params all optional.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function testDef(a, b) { b = b || 3; return b; }
function testDef(a, b) { b = b || 3; return b; }