Skip to content

Instantly share code, notes, and snippets.

@roshanca
roshanca / jQuery-plugin-authoring.md
Created August 14, 2016 02:41 — forked from quexer/jQuery-plugin-authoring.md
如何编写 jQuery 插件

创建插件


看来 jQuery 你已经用得很爽了,想学习如何自己编写插件。非常好,这篇文档正适合你。用插件和方法来扩展 jQuery 非常强大,把最聪明的功能封装到插件中可以为你及团队节省大量开发时间。

开始

@roshanca
roshanca / map-vs-flatmap.js
Created January 22, 2017 04:58 — forked from ruanyf/map-vs-flatmap.js
map vs. flatMap
const map = (array, func) => (
array.map(func)
);
const flatMap = (array, func) => (
array.reduce((result, element) => (
result.concat(func(element))
), [])
);