Open swanwish opened 7 years ago
function test(a, b, c, d, e) { console.log(a,b,c,d,e); for (var i=0; i<arguments.length; i++) { if (arguments[i] == null) { arguments[i] = '~~'; } } console.log(a,b,c,d,e); }
Call the function with: test(10, 20, null, null, 50), get the results as below:
test(10, 20, null, null, 50)
10 20 null null 50 10 20 "~~" "~~" 50
Call the function with:
test(10, 20, null, null, 50)
, get the results as below: