Skip to content

Commit f5e4224

Browse files
author
Eric Perez
committed
Update default.js
Added ES5 version of 'default value' to default.js
1 parent 8e1edf9 commit f5e4224

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

default.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,14 @@ function foo(msg="I am default"){
66
return msg;
77
}
88

9-
foo(); // I am default
9+
foo(); // I am default
10+
11+
/**
12+
* ES5 version
13+
*/
14+
function ES5Foo(msg){
15+
msg = msg || "I am default";
16+
return msg;
17+
}
18+
19+
foo(); // I am default

0 commit comments

Comments
 (0)