Possible Duplicate:
Is there a better way to do optional function parameters in Javascript?
I would like a javascript function to have optional arguments which I set a default on, which gets used if the value isn't defined. In ruby you can do it like this:
def read_file(file, delete_after = false)
# code
end
Does this work in javascript?
function read_file(file, delete_after = false) {
// Code
}