Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Default Params
- */
- function eatThePie(type, temperature, slug) {
- // set room temperature if we have no input temperature
- temperature = (!temperature) ? 23 : temperature;
- // or
- if (!temperature) {
- temperature = 23;
- }
- if (!slug) {
- slug = type + temperature;
- }
- if (temperature > 50) {
- console.log('Ouch, this ' + type + ' pie is too hot!');
- } else if (temperature < 25) {
- console.log('Please warm up my ' + type + 'pie!');
- } else {
- console.log('this ' + type + ' pie is just the right temperature. Nom nom nom');
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement