Skip to content

Instantly share code, notes, and snippets.

Tommy Wu didymu5

Block or report user

Report or block didymu5

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View main.js
new Vue({
created() {
firebase.auth().onAuthStateChanged((user) => {
this.$store.dispatch('setUser', user)
didymu5 / _.sum
Created Jul 17, 2014
Summing an Array - Nice for totaling numerical value
View _.sum
_.sum = function(obj) {
if (!$.isArray(obj) || obj.length == 0) {
return 0;
return _.reduce(obj, function(sum, n) { return sum += n; }); }
You can’t perform that action at this time.