I appreciate the brevity of the shorthand 🤷
const foo = () => ({ a: 1, b: 2 });
compare that to:
const foo = () => {
I appreciate the brevity of the shorthand 🤷
const foo = () => ({ a: 1, b: 2 });
compare that to:
const foo = () => {
// creates a new array with all sub-array elements concatenated into it recursively | |
// equivalent to array.prototype.flat with Infinity passed for depth | |
const flattenArray = (arr) => | |
arr.reduce( | |
(result, value) => result.concat( | |
Array.isArray(value) | |
? flattenArray(value) | |
: value | |
), | |
[], |
I hereby claim:
* I am zachlysobey on github. * I am zlysobey (https://keybase.io/zlysobey) on keybase. * I have a public key ASBv6iUdNuzND9RnzxBV99QvwKlaMOM-ywxoPJ7YFV1eHgo
To claim this, I am signing this object:
class AbiHelper { | |
constructor (Contract) { | |
this._abi = Contract.toJSON().abi | |
} | |
abi() { | |
return this._abi | |
} | |
publicMethodNames() { |
/** | |
* Takes a predicate and a list of values and returns a a tuple (2-item array), | |
* with each item containing the subset of the list that matches the predicate | |
* and the complement of the predicate respectively | |
* | |
* @sig (T -> Boolean, T[]) -> [T[], T[]] | |
* | |
* @param {Function} predicate A predicate to determine which side the element belongs to. | |
* @param {Array} arr The list to partition | |
* |
#Angular Resources & Best Practices
John Papa's Styleguide - Required reading. We try to follow this blindly.
link
function and doing things with element
(this isn't jQuery)(function() { | |
'use strict'; | |
angular | |
.module('dkProject.quota') | |
.factory('sourceListModal', sourceListModal); | |
const modalTemplate = ` | |
<div class="source-list-modal"> |
angular.module('my.Module').directive('dateControl', dateControl); | |
function dateControl() { | |
return { | |
bindToController: true, | |
controller: Controller, | |
controllerAs: 'vm', | |
scope: { | |
isDataReady: '=', | |
dateMilliseconds: '=' |