Last active
May 17, 2022 02:54
-
-
Save harryhan24/01a67984fedbc5dc6cc58b180fbe77d0 to your computer and use it in GitHub Desktop.
ramda 시도중
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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