Skip to content

Instantly share code, notes, and snippets.

@harryhan24
Last active May 17, 2022 02:54
Show Gist options
  • Save harryhan24/01a67984fedbc5dc6cc58b180fbe77d0 to your computer and use it in GitHub Desktop.
Save harryhan24/01a67984fedbc5dc6cc58b180fbe77d0 to your computer and use it in GitHub Desktop.
ramda 시도중
const raw = [
{a:'a', b:'b', c:'c', max: 10, min: 2 },
{a:'a', b:'b', c:'c', max: 10, min: 2 },
{a:'a', b:'b', c:'c', max: 10, min: 3 },
{a:'a', b:'b', c:'c', max: 10, min: 4 },
{a:'a', b:'b', c:'c', max: 10, min: 5 },
{a:'a', b:'b', c:'c', max: 10, min: 6 },
{a:'a', b:'b', c:'c', max: 10, min: 7 },
]
// gap = max - min
const desireResult = [
{a:'a', b:'b', c:'c',max: 10, min: 2, gap: 8 },
{a:'a', b:'b', c:'c',max: 10, min: 2, gap: 8 },
{a:'a', b:'b', c:'c',max: 10, min: 3, gap: 7 },
{a:'a', b:'b', c:'c',max: 10, min: 4, gap: 6 },
{a:'a', b:'b', c:'c',max: 10, min: 5, gap: 5 },
{a:'a', b:'b', c:'c',max: 10, min: 6, gap: 4 },
{a:'a', b:'b', c:'c',max: 10, min: 7, gap: 3 },
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment