Skip to content

Instantly share code, notes, and snippets.

View Nsengiyunva's full-sized avatar
🎯
Focusing

King Isaac Nsengiyunva Nsengiyunva

🎯
Focusing
View GitHub Profile
@onildoaguiar
onildoaguiar / sorting-an-array-by-date-with-moment-js.md
Last active July 21, 2023 04:28
Sorting an array by date with Moment.js
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)
@draxem1
draxem1 / data.json
Created September 7, 2016 02:40
Get html form data with pure Node.js, and write it to a json file as a linked list.... Enjoy!
/* start it like this, and watch it grow as data is submitted*/
{
"head": {
"head": null
}
}