Instantly share code, notes, and snippets.

View cell0.js
const hmmm = {
a: 1
}
const t1 = {
[hmmm['a']]: 1
}
const t2 = {
View cell0.js
const testArrow1 = () => 'hello'
const testArrow2 = () => {
return 'hello arrow 2'
}
function testRegular () {
return 'hello reg'
}
View cell0.js
const array = [1,2,3,4]
const log = (...args) => console.log(...args)
array.forEach(log)
View example.js
import moment from 'moment-timezone';
import verifyVisitationTime from './verifyVisitationTime';
const visitationTime = moment("2019-01-07T11:00:00-06:00"); // now, for the local timezone. But you can change that with now.tz('Asia/Tokyo');
const visitationTimef = visitationTime.format();
const deliveryTime = moment("2019-01-07T15:00:00-06:00");
const deliveryTimef = deliveryTime.format();
const verified = verifyVisitationTime(deliveryTime, visitationTime); // true because more than three hours difference
View example.js
import moment from 'moment-timezone';
import verifyVisitionTime from './verifyVisitionTime';
const now = moment(); // now, for the local timezone. But you can change that with now.tz('Asia/Tokyo');
const deliveryTime = moment("2019-01-07T14:00:00-05:00");
const verified = verifyVisitionTime(deliveryTime, visitionTime);
const slowDeliveryTime = verifyVisitionTime(deliveryTime, visitionTime, 10);
View cell0.js
import { normalize } from 'normalizr';
import ProductDocument from './product-document';
const response = {
documents: [
{ record: { product: { id: 'a' } } },
{ record: { product: { id: 'b' } } },
{ record: { product: { id: 'c' } } }
]