Hi everyone,

I am rather new to javascript. I've been searching now for quite a while trying to look for a way to give the default value to a function argument if it's not given. For example, in php one would do the follow:
PHP Code:
function func_name(foo 'default') {
...

In the above case, if foo isn't supplied while calling for the function, then foo would default to 'default'. I have tried that in javascript, but it doesn't appear to be working, so I am wondering how should I do this in javascript? Thanks