function Person(a, b={})
{
/*code*/
}
/*now, if you leave b blank, b will be {} rather than undefined*/
function addNum(a=0, b=0) {
return a + b ;
}
console.log(addNum()); //1
console.log(addNum(1)); //1
console.log(addNum(1,2)); //3
def ask_ok(prompt, retries=4, reminder='Please try again!'):
while True:
ok = input(prompt)
if ok in ('y', 'ye', 'yes'):
return True
if ok in ('n', 'no', 'nop', 'nope'):
return False
retries = retries - 1
if retries < 0:
raise ValueError('invalid user response')
print(reminder)