Learnt something new today. To set default parameters, should no input be given, check if type of variable is undefined. If it is, define default parameters. Perhaps I have already learnt this but it has left my memory stores. I think this is new information to my brain though. Pretty cool! Thanks to edabit.com , my new favourite site <3 <3 <3 function moodToday(mood) { mood = typeof mood != 'undefined' ? mood : "neutral"; return ("Today, I am feeling " + mood); }
This is me documenting my progress as a programmer. I foresee much excitement, much frustration and much cats. Always, cats.