Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
0 votes
0 answers
152 views

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 ...
Gaurav's user avatar
  • 192
1 vote
1 answer
56 views

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
51 views

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
61 views

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
38 views

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
371 views

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,173
0 votes
0 answers
33 views

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
216 views

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
344 views

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
103 views

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
61 views

I have an array of object with data: items = [ { ....someFields timeFrom: { hour: 17, minute: 15 } }, { ....someFields timeFrom: { hour: 12, ...
Arams's user avatar
  • 199
0 votes
5 answers
104 views

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
35 views

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
100 views

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
89 views

I have two objects: const people = [ { name: "Dave", fruit: ["apple", "pear"], veg: ["asparagus", "peas"] }, { name: "Frank",...
Hayley's user avatar
  • 321
0 votes
2 answers
903 views

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
1 vote
2 answers
36 views

How to group the matching data in array of object and get the matching data length to get the average value. var getdataObj = [{ "finalUrl": "https://www.amazon.in/", "fetchTime": "2022-10-...
sathish kumar's user avatar
1 vote
2 answers
49 views

I have a JavaScript object with several properties: { banking: { account_number: null, account_type: null, bank_name: null, debit_day: null }, fitment: { date: null, ...
RookieSA's user avatar
  • 101
1 vote
1 answer
82 views

I'm using a custom widget in Jupyter. After upgrading to a new machine it stopped functioning. Checking the javascript console in the browser window running the notebook I see the error ReferenceError:...
John's user avatar
  • 893
0 votes
0 answers
49 views

I am trying to understand how debounce works, but it does not seem to do what I think it would do. Here is an example const fn = _.debounce( () => { document.getElementById("result")....
zrbecker's user avatar
  • 1,603
1 vote
2 answers
137 views

I have an array var data = {email: '[email protected]', phone: '3434344332', firstName: 'john', lastName: 'Doe'}; How do i remove one or more elements from the array? I Tried _.without( data, data....
johnmills's user avatar
1 vote
1 answer
48 views

I need to remove some objects. My main object is: [ { objectName: {...somefields} list: [ { pr: {id: 'someid1', l: [ ...
Mike's user avatar
  • 423
0 votes
4 answers
202 views

I have an array of objects where each index is one week where I bought groceries. Meaning that array[0] is the first week, array[1] is the second and the so on. What I need to do is do sum all the ...
Shan's user avatar
  • 3
0 votes
1 answer
134 views

I'm learning different implementations of the memoize function, and something is confusing me. Here is one version of the code: _.memoize = function(func) { let cache = {}; return function() {...
GloriousKaboom's user avatar
2 votes
1 answer
747 views

I understand how a simple lodash merge works but as I was playing around with it to try more complicated scenarios I got confused about how the output is being formed for instance: const a = [{ h: 1, ...
j obe's user avatar
  • 2,097
1 vote
1 answer
109 views

Ive created a simple backbone app that gets data from MySQL database about users to display in a view called LeaderBoardView. Below is the HTML code for the view, <body> <div id="...
Kavishka Rajapakshe's user avatar
0 votes
1 answer
63 views

I have a situation where i need to find the duplicate element in array of object. Object contains 4 properties { id:"1", userName:"userName", name:"name1", address:"...
venkatraman hiregange's user avatar
1 vote
2 answers
59 views

I have a jQuery file which also uses unserscore.js. It controls the selections of dates and different venues. For one of the pages it also controls which visuals are displayed depending on the type of ...
DavidN's user avatar
  • 79
1 vote
3 answers
152 views

considering var desserts = [ { name: 'Chocolate Cake', ingredients: ['cocoa', 'flour', 'sugar', 'eggs', 'milk', 'butter' ], type: 'cake' }, { name: 'Snickerdoodles', ...
boshao13's user avatar
4 votes
4 answers
7k views

trying to use underscore.map to iterate over array of objects and add a boolean property to each object based on if the object value passes a truth statement. var desserts = [ { name: 'Chocolate ...
boshao13's user avatar
1 vote
2 answers
544 views

I try to use the modular import from the underscore in a typescript app like this: import map from 'underscore/modules/map' It works and does the job, but cause the below error: Cannot find module '...
marzzy's user avatar
  • 794
0 votes
3 answers
42 views

I have an array of objects in the following form- let result = [ { a: 1, b: 2, c: 3, newValues: { a: 10, b: 20, c: 30 } ...
skeletor's user avatar
0 votes
2 answers
158 views

I'm trying to recreate the functionality of the underscore _.invoke for learning purposes and I would like to really understand how it works as it seems to be something not too complicated. The ...
dr3nan's user avatar
  • 47
-2 votes
1 answer
650 views

I am stuck with issue. Has anyone encountered this. As I am unable to get it what it is asking for. This is how I imported this library highlighted in yellow. This how it is showing in browser error.
ammad khan's user avatar
  • 1,164
0 votes
3 answers
57 views

Given an object searchable, is there a simple way of returning all the id values using lodash or underscore.js (or equivalent) where I can define the path to id? const searchable = { things: [ ...
jeeves's user avatar
  • 2,031
-1 votes
2 answers
64 views

i have an object { "name" : "foo", "tag_name" : "grocery", "tag_id" : "id", "tag_nested_id" : "123", } I want ...
TenX's user avatar
  • 3
0 votes
1 answer
296 views

I am trying to recreate .invoke() function. I am able to call the function, but struggling with passing the arguments. I tried using call and apply, but couldn't make it work. Here is my code: _....
vadim-nest's user avatar
0 votes
2 answers
235 views

I'm looking for a way to get the same functionality of the Lodash _.forIn() Method but without using Lodash. I can use Underscore however. This is what the method does https://www.geeksforgeeks.org/...
codebomb's user avatar
-1 votes
1 answer
115 views

So on internet they solve using: from functools import reduce fib = lambda n: reduce(lambda x, _: x+[x[-1]+x[-2]],range(n-2), [0, 1]) print(fib(5)) Fibonacci program I don't understand what's the ...
exmeta's user avatar
  • 3
1 vote
3 answers
108 views

How to count the no of occurences of the 'value' key in a object inside an array & append the count to each value if any. Here 'a' is the source data var a = [ { id: 1, value: "10000"...
Yogi's user avatar
  • 13
1 vote
1 answer
643 views

this is my first question and I hope I am not coming up with something totally stupid. I am new to JS and Node.js. I can solve easy issues on my own, but with this pollution report I need some advice. ...
Klaus53123's user avatar
0 votes
1 answer
38 views

I have some data that is an array of objects like so: let employees = [ { emp_id: "1", course_data : [ { info: "info", ...
J.spenc's user avatar
  • 359
1 vote
2 answers
654 views

I have some ionic segment buttons that essentially act as toggle switches. I'm trying to limit the rate at which the effects of the toggles can be switched/selected) and have tried Debounce & ...
Phill Healey's user avatar
  • 3,200
1 vote
1 answer
191 views

I am playing around with rendering templates using with Underscore.js (Backbone.js app). I'm running into the following issue, where a part of the variable name in the template I am trying to render ...
Vin's user avatar
  • 31
2 votes
3 answers
4k views

I have a deeply nested data structure and I am interested in matching a certain value inside my array (and array of arrays) and then pushing some data inside an accompanying array. For example ...
Ara's user avatar
  • 63
0 votes
1 answer
202 views

I have this function that call a new one with _.map function that cycle each element or array an than it could push items in Apify Storage, but the element of dataset is ever 0. Why? const Apify = ...
Mariano's user avatar
  • 455
3 votes
1 answer
5k views

I'm getting this error when I copy-paste the underscore.js to my console. Error screenshot "Uncaught SyntaxError; Unexpected token 'export'" I tried on both Chrome Version 100.0.4896.127 and ...
seckin.furkan's user avatar
1 vote
2 answers
250 views

let a = { b : null } _.get(a, 'b',''); //return null but _.get (a, null, '') //return '' Is null a falsy value for _.get()? let a = { b : {c:{ } } //basically a nested object I'm trying to ...
Gaurav Garg's user avatar
1 vote
1 answer
346 views

I've been trying to rewrite the _.defaults method from underscore.js and I keep getting this error: should copy source properties to undefined properties in the destination object‣ AssertionError: ...
Robert R's user avatar
1 vote
1 answer
159 views

I have an array like this data = [ { name : "sa", attributes : [{skin : "green"},{nose:"good"}]}, { name : "sa", attributes : [{skin : "red"},{...
Code Guru's user avatar
  • 15.8k

1
2 3 4 5
115