diff --git a/lib/flash.js b/lib/flash.js index a278bc1..095a9ed 100644 --- a/lib/flash.js +++ b/lib/flash.js @@ -65,8 +65,9 @@ function _flash(type, msg) { var args = Array.prototype.slice.call(arguments, 1); msg = format.apply(undefined, args); } else if (isArray(msg)) { + msgs[type] = msgs[type] || [] msg.forEach(function(val){ - (msgs[type] = msgs[type] || []).push(val); + msgs[type].push(val); }); return msgs[type].length; }