How to install Bullet Train for oh-my-zsh on Ubuntu.
$ sudo apt-get install zsh
$ sudo apt-get install git-core
'use strict';
const callMock = (object) => new Promise((resolve) => setTimeout(() => resolve(object), 500));
const print = (method, petOne, petTwo) => {
console.log(`Method: ${method}`);
console.log(`PetOne: ${JSON.stringify(petOne)}`);
console.log(`PetTwo: ${JSON.stringify(petTwo)}`);
};
const Moment = require('moment')
const array = [{date:"2018-05-11"},{date:"2018-05-12"},{date:"2018-05-10"}]
const sortedArray = array.sort((a,b) => new Moment(a.date).format('YYYYMMDD') - new Moment(b.date).format('YYYYMMDD'))
console.log(sortedArray)
const persons = [ | |
{ 'name':'Luke', 'age':10}, | |
{ 'name':'Leia', 'age':10}, | |
{ 'name':'Vader', 'age':40} | |
]; | |
const ascending = x => y => x > y; | |
const ageSort = (x, y) => ascending(x.age)(y.age); |