Skip to content

Instantly share code, notes, and snippets.

View deleteman's full-sized avatar

Fernando Doglio deleteman

View GitHub Profile
function myFn(variable1, variable2) {
variable2 ??= " default value"
return variable1 + variable2
}
myFn("this has", " no default value") //returns "this has no default value"
myFn("this has no") //returns "this has no default value"
myFn("this has no", 0) //returns "this has no 0"