kaniosrn-j
6/1/2017 - 8:11 PM

Set default function argument ES5

Set default function argument

	function calculateBill( total, tax, tip ){

		if (tax === undefined) {
			tax = 0.3
		}
		if (tip === undefined) {
			tip = 0.15;
		};

		return total + (total * tax) + (total * tip);
	}