function decorate(text, symb) { return symb + text + symb } function decorateSmart(text, symb) { if (typeof symb === 'undefined') symb = '$' return symb + text + symb }
decorate('hello', '*')
decorate('hello')
decorateSmart('hey', '*')
decorateSmart('hey')