Skip to content

Instantly share code, notes, and snippets.

:octocat:
Make beautiful code, not war.

Daniel DiGangi dandigangi

:octocat:
Make beautiful code, not war.
Block or report user

Report or block dandigangi

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
@dandigangi
dandigangi / functions.js
Last active Sep 23, 2018
Javascript ES5 vs ES6 Functions
View functions.js
// Expanding on a conversation about being terse with ES5 and ES6 functions on Twitter w/ @podrazque
// Being terse isn't inherently bad but it is important to think about how other developers will infer and understand what was written.
//////
// Example of a terse, one line function using a ES6 fx expression w/ arrows and a implicit return.
const objToArray = (data) => Object.keys(data).map((key) => data[key])
// See below for overview of some different function usage w/ ES5 & ES6
const magic = 'poof';
View babel-7-and-jest.js
// Babel Deps
"@babel/core": "7.1.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "7.1.0",
"@babel/preset-react": "7.0.0",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "8.0.1",
"babel-jest": "23.6.0",
View RequestService.js
(function ( define ) {
'use strict';
define([], function () {
var RequestService = function ( $http, $q ) {
// Return dummy data for now
return {
You can’t perform that action at this time.