5,735 questions
0
votes
0
answers
188
views
Conflict between lodash.js and underscore.js
I am working on integrating a plugin into my application which resulted in lodash.js and underscore.js conflict. I have underscore.js implemented in my entire application and this plugin which I am ...
1
vote
1
answer
64
views
Inserting unique attribute to HML tag element in loop
I have a supersite that uses all kinds of js, including backbone.js and underscore.js. On one of my pages, I have the piece of code below:
<#loop:main_tlds_price_add#>
<tr>
<td ...
1
vote
2
answers
55
views
Sort Backbone Collection based on a file order list
I have a inherited a system that utilizes a Backbone collection of files that needs to be sorted based on a series of values. The order variable is saved when you slide different files into a position ...
0
votes
1
answer
65
views
Arguments object not working on Underscore first type function
For an exercise, I have to reproduce the first function from the Underscore.js library.
The code I wrote passes all the tests, except "should work on an arguments object".
I passed these ...
1
vote
0
answers
43
views
Uncaught TypeError: App.Routers.Maintenances.MyRouter is not a constructor
I am using backbone js as frontend in rails 7 application. In index.html file I have called backbone main file. code is coming in this file. But here I have initialise router file. In which getting ...
0
votes
1
answer
378
views
Error type DeepTypeOfCollection is not generic
While running NG BUILD, I am getting an error: type DeepTypeOfCollection is not generic. Also Type alias DeepTypeOfCollection circularly references itself.
0
votes
0
answers
37
views
Why _.clone() doesn't copy object methods?
I use the underscore library to copy objects, the _.clone() method. And this method works differently on different versions of angular, or maybe the problem is something else?
F.e:
class FooBar {
...
0
votes
1
answer
219
views
Why do sites that use lodash or underscore not work in Opera?
For whatever reason, some update in Opera has caused me to get frustrated for about a week now trying to figure out why Opera no longer works on my productivity sites - like StreamTime or Elementor (...
0
votes
1
answer
350
views
Returning the last computed result in a throttled function
I am working on a exercise based of the underscore _.throttle function. Our function is slightly modified as we have the return the last computed result if the _.throttle function is still waiting to ...
1
vote
2
answers
104
views
How to skip over the first iteration when one argument is undefined?
I am working on an exercise that is based on the reduce exercise from underscore.js. Now, I have a solution that works but I believe it can be done better since I used a lot of copy pasting in my ...
0
votes
1
answer
68
views
_lodash, sort by 2 fields(numbers, time)
I have an array of object with data:
items = [
{
....someFields
timeFrom: {
hour: 17,
minute: 15
}
},
{
....someFields
timeFrom: {
hour: 12,
...
0
votes
5
answers
104
views
Merge array of objects with array values into a single object
Using plain JavaScript or lodash, what's the easiest way to transform an array of objects into a single object, while concatenating any array values?
I can achieve it on a single property using _....
0
votes
1
answer
44
views
How to chain Underscore methods to populate an object from nested array?
I have an array of objects - say, NFL teams. Each object (team) has a property - array of first names of team players.
var nflTeams = [
{ name: 'Kansas City Chiefs', playersFirstNames: ['Shane', ...
0
votes
2
answers
108
views
Having a problem with rewriting invoke function inspired by underscore library
I'm a beginner and trying to rewrite an underscore function _.invoke.
I'm trying to make the function so it returns an array with the results of calling the method on each value in the collection.
_....
0
votes
3
answers
97
views
Javascript find objects that contain matching elements from arrays in another object
I have two objects:
const people = [
{
name: "Dave",
fruit: ["apple", "pear"],
veg: ["asparagus", "peas"]
},
{
name: "Frank",...