Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 29 2016 21:28
  • Dec 29 2016 21:28
  • Dec 29 2016 21:28
  • Dec 29 2016 21:28
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
julian-code
@julian-code
 return _.intersectionWith(...allMatches,
        (match1, match2) => {
          if (match1.win === match2.win && match1.matchId === match2.matchId) {
            return true;
          }
          return false;
        });
Thanks for the help :)
illuminist
@illuminist
Glad too
julian-code
@julian-code
How do you find and set a value on a specific object in an array?
Or more like find a specific object and set a value on that object.
illuminist
@illuminist
Use findIndex to get index of object in an array then use that index to set object value
Alexander Sivashev
@shyr1punk
Hi. I'm interesting what community think about a this proposal: memoize: Warning: for memoized function with 2+ args use resolver lodash/lodash#4641 implemented here lodash/lodash#4702
If you like it, please send a reaction in issue or comment or suggest changes/help with implementation
julian-code
@julian-code
Hey guys. I need to loop through an array calculating the difference between current element and next element. Such as this in a for loop:
eloDiff: Number(x.elo) - Number(data[index + 1].elo),
Can you use some of lodashes functions to do the same?
julian-code
@julian-code
It should iterate over current and next.
SOULE Théo
@XxSven_gitlab
Hello, I have a little question about how lodash is delivered. The syntax is ;(function() {}.call(this)); yet on stackoverflow I can only found explanations for (function () {}).call(); the parenthesis is not at the same place
can someone please explain to me what is happening here as I am a beginner ?
illuminist
@illuminist
@XxSven_gitlab Those get evaluated to be the same, ultimately they become function () {}.call(this).
SOULE Théo
@XxSven_gitlab
@illuminist But when I write this in js fiddle I get syntax error if I don't surround it by parenthesis
illuminist
@illuminist
(function () {}) this one get boiled down into function object first before accessing .call, while (function () {}.call(this)) is an entire expression for function call
It isn't an usual syntax that you use in everyday job, but still good to know
SOULE Théo
@XxSven_gitlab
ok ty, it's weird ^^'
NursahKara
@NursahKara
hello, I am new in lodash so i don't know how to use with react native. I have a question. I have a project which is related to firebase. I want to see the information of which user logs in.With the map function, I can access all the data in the database but I only want to see the data of the logged-in user.should I use the find function to achieve this?Do you have a suggestion?
const mapStateToProps=state=>{
const currentUser=firebase.auth().currentUser;
const email=currentUser.email;
const profileInformationList=_.map(state.profileInformationList,(val,uid)=>{
return {...val,uid}
});
return {
profileInformationList
}
}
I want to use currentUser.email
illuminist
@illuminist
What is the shape of your state.profileInfomationList?
NursahKara
@NursahKara
it is an array
illuminist
@illuminist
What is the shape of object inside of the array?
NursahKara
@NursahKara
email name surname nick birthday
illuminist
@illuminist
So you want to find an object with email that match currentUser?
NursahKara
@NursahKara
yes
illuminist
@illuminist
Then it is better to use _.find to get one object from the array
NursahKara
@NursahKara
i think so too but i couldn't use it with react native
I can pull all the data with the map function, but it gets confused when I use the find function.
illuminist
@illuminist
It should not be difference from usual javascript regardless of what platform
NursahKara
@NursahKara
thanks your time @illuminist
WebAzOps
@WebAzOps
Selam kervan
thoo1
@thoo1
Does anyone know how _.isEqual treats date objects?
Does it compare using ===, or date1.getTime() === date2.getTime(), or some other way?
Reason I ask is because in my code, I am debugging, I am seeing that the two date objects I am comparing using _.isEqual is returning false even though the .getTime() for both dates are the same
Toom
@ProditorMagnus
Toom
@ProditorMagnus
staying with that then
Zach Reedy
@DatZach
Hello, I'm working on a port of Lodash for the latest version of GameMaker which now supports functions as a first class citizen and structs (which emulates JS Objects). I was wondering if someone know who I should contact to determine what is permissible as far as naming and licensing, as this is derived from the Lodash API. There's some features that've been omitted as they don't make sense in GML. Additionally, none of Lodash's codebase has been utilized, it's purely the API definitions.
chhikaradi1993
@chhikaradi1993
I have two sets, containing random number of objects, few of them may be same in both sets with updated properties. Is there any way to calculate diff of these sets containing objects?
illuminist
@illuminist

in both set with updated properties

What does that actually mean?

chhikaradi1993
@chhikaradi1993
I need to get diff of two Sets, which may contain objects as elements. Is it possible to get diff for these type of sets?
illuminist
@illuminist
For an object, it can be done by using .differerenceBy or .differenceWith depends on what you want to compare
David Siah
@dsiah
Hello (first timer here), I'm working on a super simple doc PR but I noticed that builds are somewhat broken. I believe i'm missing a step because there are no lib/ folders and the issue in build is searching for a module that would be located there:
> lodash@5.0.0 doc /Users/dsiah/OSS/lodash
> node lib/main/build-doc github && npm run test:doc

internal/modules/cjs/loader.js:979
  throw err;
  ^

Error: Cannot find module '/Users/dsiah/OSS/lodash/lib/main/build-doc'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:976:15)
    at Function.Module._load (internal/modules/cjs/loader.js:859:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
David Siah
@dsiah
and this is after running npm i (my version is 6.14.4)
Ahammad
@Ahammad-raj
Hello Everyone
lodash 4.17.15 is exposed to sonatype-2019-0467 vulnerability. Could you please check this and provide fix
Prachi Shirish Khadk
@prachi_khadke_twitter
Hi. If i groupBy an array of objects by integer, the integer property is returned as a string key in the result. Is it possible to preserve the key as integer?
var users = [
  { user: 'barney', age: 36, active: true },
  { user: 'fred',  age: 40, active: false },
  { user: 'travis', age: 37, active: true},
  { user: 'david',  age: 40, active: false },
  { user: 'tom', age: 37, active: true}
];

result = _.groupBy(users, 'age');
Prachi Shirish Khadk
@prachi_khadke_twitter
nm. i realized that it will lead to invalid json schema
SAGO
@SAGOlab

Hi there,

I have this two arrays:

var coordinateClienti = [
  [12.7592267, 43.0696255],
  [12.7037126, 42.9575853],
  [12.5263973, 43.105579],
  [12.7803655, 43.2322369],
  [12.4302894, 43.0265033],
  [12.1659394, 43.5551518],
  [12.5471666, 42.6143734],
  [12.7860033, 43.2321763],
  [12.3263852, 43.3081323],
  [12.7020796, 42.9564996],
  [12.191765, 43.5116042],
  [12.649205, 42.5624235]
]

var steps = [
  [12.402996209906489, 43.1070321],
  [12.7037126, 42.9575853],
  [12.7020796, 42.9564996],
  [12.649205, 42.5624235],
  [12.5471666, 42.6143734],
  [12.402996209906489, 43.1070321],
]

there is a lodash function that compare this two arrays and return me true if some array element of one are contained in the other?

thanks