Skip to content

Instantly share code, notes, and snippets.

Avatar

Bart Read bartread

View GitHub Profile
View identity-and-noop.js
function noop() { }
function identity(x) { return x; };
View example-config-object-for-destructuring.js
var config = {
delay: 200,
duration: 500,
easing: function gimmeSomeEase(thingummy) {
var aResult = ...;
// Maybe do some stuff here
return aResult;
},
tick: {
tick$$1: function () {
View without-destructured-assignment.js
var delay = config.delay || 0,
duration = config.duration || 300,
easing = config.easing || identity,
tick$$1 = (config.tick ? config.tick.tick$$1 : noop) || noop,
css = config.css;
View destructured-assignment.js
var { delay = 0, duration = 300, easing = identity, tick: tick$$1 = noop, css } = config;
View mathTan_ES5.js
'use strict';
(function () {
var RADIANS_IN_A_CIRCLE = 2 * Math.PI;
var ONE_DEGREE = RADIANS_IN_A_CIRCLE / 360;
var lookup = [];
for (var index = 0; index < 360; ++index) {
lookup[index] = Math.tan(index * ONE_DEGREE);
View mathTan_ES2015Plus.js
'use strict';
(function () {
const RADIANS_IN_A_CIRCLE = 2 * Math.PI;
const ONE_DEGREE = RADIANS_IN_A_CIRCLE / 360;
let lookup = [];
for (let index = 0; index < 360; ++index) {
lookup[index] = Math.tan(index * ONE_DEGREE);
View mathCos_ES5.js
'use strict';
(function () {
var RADIANS_IN_A_CIRCLE = 2 * Math.PI;
var ONE_DEGREE = RADIANS_IN_A_CIRCLE / 360;
var lookup = [];
for (var index = 0; index < 360; ++index) {
lookup[index] = Math.cos(index * ONE_DEGREE);
View mathCos_ES2015Plus.js
'use strict';
(function () {
const RADIANS_IN_A_CIRCLE = 2 * Math.PI;
const ONE_DEGREE = RADIANS_IN_A_CIRCLE / 360;
let lookup = [];
for (let index = 0; index < 360; ++index) {
lookup[index] = Math.cos(index * ONE_DEGREE);
View mathSin_ES5.js
'use strict';
(function () {
var RADIANS_IN_A_CIRCLE = 2 * Math.PI;
var ONE_DEGREE = RADIANS_IN_A_CIRCLE / 360;
var lookup = [];
for (var index = 0; index < 360; ++index) {
lookup[index] = Math.sin(index * ONE_DEGREE);
View mathSin_ES2015Plus.js
'use strict';
(function (){
const RADIANS_IN_A_CIRCLE = 2 * Math.PI;
const ONE_DEGREE = RADIANS_IN_A_CIRCLE / 360;
let lookup = [];
for (let index = 0; index < 360; ++index) {
lookup[index] = Math.sin(index * ONE_DEGREE);