Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
44 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 ...
adeguk Loggcity's user avatar
1 vote
2 answers
41 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 ...
xtine.k's user avatar
  • 39
0 votes
1 answer
58 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 ...
Detla888's user avatar
1 vote
0 answers
34 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 ...
Divya Keswani's user avatar
0 votes
1 answer
316 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.
mruanova's user avatar
  • 7,065
0 votes
0 answers
33 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 { ...
Euphoria's user avatar
0 votes
1 answer
198 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 (...
hazrpg's user avatar
  • 512
0 votes
1 answer
233 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 ...
Niels Koop's user avatar
1 vote
2 answers
72 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 ...
Niels Koop's user avatar
0 votes
1 answer
52 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, ...
Arams's user avatar
  • 189
0 votes
5 answers
96 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 _....
Chris Fulstow's user avatar
0 votes
1 answer
34 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', ...
curious_orange's user avatar
0 votes
2 answers
91 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. _....
OWELEY's user avatar
  • 25
0 votes
3 answers
81 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",...
Hayley's user avatar
  • 291
0 votes
2 answers
723 views

Using Underscore.js with require.js: Uncaught ReferenceError: _ is not defined

I have Underscore.js 1.13.2 and I include it using requireJS 2.1.14. paths = { 'underscore': my_folder_path + "/underscore", // for underscore.js .. //path of other files } I see in the ...
Arshad Rehmani's user avatar

15 30 50 per page
1
2 3 4 5
383