Skip to content

Instantly share code, notes, and snippets.

View przemek-nowicki's full-sized avatar
🎯
Focusing

Przemek Nowicki przemek-nowicki

🎯
Focusing
View GitHub Profile
@weianofsteel
weianofsteel / text editor#3
Created April 10, 2021 19:52
text editor#3
inline: {
inDropdown: false,
className: undefined,
component: undefined,
dropdownClassName: undefined,
options: ['bold', 'italic', 'underline', 'strikethrough', 'monospace', 'superscript', 'subscript'],
bold: { icon: bold, className: undefined },
italic: { icon: italic, className: undefined },
underline: { icon: underline, className: undefined },
strikethrough: { icon: strikethrough, className: undefined },
@JamieMason
JamieMason / group-objects-by-property.md
Created September 14, 2018 07:38
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Key or Property Value

Implementation

const groupBy = key => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = obj[key];
    objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
    return objectsByKeyValue;