Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Doktor Avalanche
Dec 30, 2008

fuf posted:

edit: I did it with a promise:

I suggest you take a look at async/await, it's much more readable than callbacks and promises.

Adbot
ADBOT LOVES YOU

Doktor Avalanche
Dec 30, 2008

Deadite posted:

Is there a quick way to compare two arrays of objects where neither the array or the objects are in the same order, but have the same contents?

For example
code:
var array1 = [{“key1”:”a”,”key2”:”b”},{“key3”:”c”,”key4”:”d”}];
var array2 = [{“key4”:”d”,”key3”:”c”},{“key2”:”b”,”key1”:”a”}];
Both arrays contain the same objects just in different order, but I can’t find a way to compare when they’re like this. I can find a solution if the objects with the same key/value pairs had the same index in both arrays, but I’m not sure what to do if they have different positions within the arrays.

lodash?

Doktor Avalanche
Dec 30, 2008

use a framework (express, koa, fastify etc.)

Doktor Avalanche
Dec 30, 2008

there's "nvm for windows"

Doktor Avalanche
Dec 30, 2008

would using the regular Date lib with only UTC avoid these kinds of mixups? that's what we do at my job.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply