logoalt Hacker News

nvme0n1p1 • yesterday at 10:16 PM • 2 replies • view on HN

Yes but why? Why should I import a giant dependency to do this:

  a = [1, 2, 3];
  foo = effect.Array.append(a, 4);
instead of using what's built in to the language?

  a = [1, 2, 3];
  foo = [...a, 4];

Replies

itishappy • today at 12:57 AM

You wouldn't. Effect isn't an array library.

slopinthebag • yesterday at 10:20 PM

did you read the docs? it says

"Use when you need to guarantee a non-empty result after adding a required trailing value."

...whatever that means lol

➕ show 2 replies