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
-6 votes
1 answer
148 views

I have an object obj; and I then obtain an array arr of key-value pairs. Assuming that the key sets of obj and of arr are disjoint (i.e. no key appears in both) - how do I efficiently add all pairs in ...
einpoklum's user avatar
  • 137k
24 votes
2 answers
2k views

In JavaScript, when you do something like this, function connect() { var ws = new WebSocket(url); ws.onmessage = function(e) { window.alert(e.data); }; } it will work. But why ...
Maestro's user avatar
  • 9,836
1 vote
1 answer
68 views

I’m working on a WordPress website using the Elementor Pro page builder, and I’m trying to integrate a custom-styled Google Map on the "Contact Us" page. What I’ve done so far: Created a ...
Muhammad Ramzan's user avatar
-1 votes
1 answer
87 views

I'd like to have the loadConfig function async and just finish after the resource has been loaded. await fetchetc. How can I declare it in this object syntax as an async function? var QMEM = QMEM || { ...
rhavin's user avatar
  • 1,798
0 votes
0 answers
132 views

I'm working on a JavaScript extension for WhatsApp Web, and I'm facing a problem I can't seem to solve. The goal of my extension is to correct and manipulate the text in the message input of WhatsApp ...
brandoniscoding's user avatar
0 votes
0 answers
43 views

I have an object taken from the DOM who's actual offsetHeight I can not correctly get. When trying to console.log the object to check the property, it does show the correct offsetHeight. But when I ...
foooch's user avatar
  • 1
0 votes
0 answers
27 views

I found some odd things and am looking for explanations as to how and why let a = [] ; a.push({foo:"bar",bar:"foo"}] ; console.log(a) ; As expected, prints out: [[object Object] { ...
rolinger's user avatar
  • 3,196
0 votes
0 answers
24 views

So I wrote up this helper function when I first started my project to help update objects that I would get from an API. export const setValRecursive = (currObj: any, newObj: any) => { Object.keys(...
Jennifer Nguyen's user avatar
-1 votes
1 answer
67 views

I have a set of objects, that contain references to other objects. There is always a general reference: nextObject. But sometimes, I know more about the object beside me. So I could use a member ...
user2171796's user avatar
0 votes
1 answer
45 views

I am implementing an extended class from Array with numerical methods such as sum, mean, std, etc. There is no problem to instantiate an object with zero or 2+ elements, but I can't implement one-...
msampaio's user avatar
  • 3,463
-5 votes
1 answer
112 views

I need to style specific elements by id using given object. Keys and values in projectSkillsMap object corresponds to ids in html file. When user clicks on element with id listed in object keys ...
NanoMuffin's user avatar
-5 votes
1 answer
94 views

I'm my scenario I have to create a lot of objects (100k+). Those objects can 'evolve' in the course if their life. Some will stay practically unchanged, others with will mutate and have a bunch of ...
Jurijs Kovzels's user avatar
0 votes
1 answer
72 views

I'm a newbie to Javascript. I wish to know how to get the key as 'personObj', 'carObj, 'workDetailsObj', 'displayFunction' and 'primitiveValue' and print those values in console? Also, how to print ...
TEC_Abode of Learning's user avatar
0 votes
1 answer
25 views

const menuFilteredProducts = getMenuWiseProduct(products); const categoryFilteredProducts = getCategoryWiseProduct(products); let mergedProducts = []; const prioritizeCategory = true; if (...
Chinthan K's user avatar
5 votes
1 answer
270 views

I'm trying to use custom DOM events to communicate between the main world and the isolated world for a page in a webextension in Firefox. When trying to access an event object property, I get an ...
Nanigashi's user avatar
  • 708
0 votes
1 answer
64 views

I am practicing fetching API data and displaying it on a web page. I am using Go to fetch quotes data from an API service. I want an additional slideshow functionality for the web page that should ...
John Eliud's user avatar
0 votes
0 answers
106 views

Take the following example from their home page: { "type": "Feature", "geometry": { "type": "Point", "coordinates": [125.6, 10.1]...
Dainank's user avatar
  • 2,613
3 votes
3 answers
79 views

I have object key value in below format. { "Code1": { "char10": "ch1", "number1": "1", "text1": "txt1" ...
mkchoube's user avatar
  • 123
0 votes
0 answers
66 views

My script doesn’t work well. When the button “b5” clicked with ouside <form ...> ... element, the buttons b5 and b4 deseapper and the buttons b1,b2,b3 appear. This work normaly when my code ...
Fulbert KOFFI's user avatar
0 votes
1 answer
58 views

I need to construct a function, which takes a black-box one-argument function as an argument. And I need to know, how many times the black-box function uses its argument Example signature: function ...
makxca's user avatar
  • 26
-1 votes
1 answer
131 views

PROBLEM Hi, I have some JS that manipulates the DOM to show / hide certain elements when needed. It works perfectly when the event handler is fired (click event). The problem is that when I refresh ...
Action Jackson's user avatar
0 votes
3 answers
117 views

I'm currently building a Pokémon application, therefor I'm accessing data from PokéAPI and will store specific data in a variable, such as name, id and type. Currently I'm facing issues to store the ...
Ameh's user avatar
  • 7
1 vote
0 answers
36 views

After clicking on any lower check box in the grid the vertical scrollbar position changed to top level in the grid. How to keep the vertical scrollbar in same position after reloading the grid.? after ...
Rajesh's user avatar
  • 11
-2 votes
1 answer
38 views

Currently learning JS, im a beginner. I created an object to tinker with, and i want to give it some properties that are dependent on th previous properties of the same object. I have managed to solve ...
YounesMeftah's user avatar
0 votes
0 answers
14 views

I would like to use an image as a button for me to go to another cell in the same sheet. Happy if I can get someone to share the appropriate scripts. Thanks I have tried a button to go to another ...
Jeffry Jimbun's user avatar
0 votes
2 answers
39 views

I've been struggling with how to retrieve data from a JSON structured response to a query of a Sony Bravia TV. I've tried SEVERAL syntax variations to get just a single element's data, but no joy. ...
BrunoJ's user avatar
  • 1
0 votes
0 answers
37 views

how to click cq-toggle element dynamically using javascript? When i click manually on cq-toggle menu item it actually adds active class to the element cq-toggle and add one div content in document ...
questp's user avatar
  • 171
0 votes
0 answers
64 views

It is simple to create a variable such as "a", but as soon as I want to create "a.b", I need to know that "a" exists first, I'm trying to create a function such as "...
Dennis Bareis's user avatar
0 votes
2 answers
82 views

I have been trying to figure out how to merge several JSON strings into one. My method is this: if (observations[31]) { // Ignore this. document.getElementById("ajaxrainmo").textContent = ...
JesseLikesWeather's user avatar
0 votes
2 answers
63 views

I'm trying to merge an array of object by removing the ones which have the same code attribute and computing its times attribute. given the following array: let itemsTimes = [ { item: { ...
user3347778's user avatar
1 vote
0 answers
276 views

I have issues selecting certain elements on a specific web page, querySelector returns null unless I first go through one of the parent element. I tried chaining them together but still I eventually ...
user26722241's user avatar
-1 votes
2 answers
74 views

consider below 2 array of objects, say arr1 and arr2. based on id, if any new item exist in arr2 copy item to arr1 and remove item from arr1 if that item not present in arr2. Tried something like this,...
Praveen Kumar's user avatar
-2 votes
1 answer
24 views

I have this data and would like to extract the Title data only and insert it as a id and value. const dataSource = [ { id: '1', Title: 'My World', Price: 10, }, { id: '2', Title: 'My Home', Price: 20, ...
user26605790's user avatar
1 vote
0 answers
51 views

As a preface for my question, I am very new to JavaScript and come from a strongly-typed language background (e.g. Java and C++). Although I have prior experience with JavaScript, I am not entirely ...
KeyboardClone's user avatar
0 votes
1 answer
59 views

The code below works fine if I remove the console log line but not with it function gcd(a, b) { while (b !== 0) { console.log(a,b) [a, b] = [b, a % b]; } return a; } ...
Rajashekar Reddy's user avatar
1 vote
2 answers
169 views

Strings are primitives, meaning they don't actually have methods or properties associated with them. According to MDN In contexts where a method is to be invoked on a primitive string or a property ...
Sincere Tuitt's user avatar
0 votes
1 answer
63 views

If I write a function that creates a new person and attach it to an onClick event on a button, how can I access the data that was entered without a variable name? When a user presses the button, the ...
Jason Bruce's user avatar
1 vote
0 answers
35 views

I have this JavaScript Proxy code which I want to trigger the set handler that can tell me the first and second keys. This means that when I try to set globalVar.a.b = "55b" only the line ...
dede's user avatar
  • 31
1 vote
0 answers
27 views

I have an object named facility facility = { facility_id: 495867, facility_name: "4 Pig farms Brookvale", registered_business_name: "BROOKVALE FARMS COMPANY PTY LTD", ...
That_LEGO_Guy's user avatar
0 votes
4 answers
74 views

please I need help with this const obj = {a="", b="good", c=false, d="", e="excellent"} I just want to know total empty and false. where my answer is suppose ...
yusufff's user avatar
  • 73
0 votes
1 answer
73 views

I have an array of objects where each object defines a field in a React form. I want to display different sequence of fields depending on a boolean state. This means that I need to insert either one ...
VikSil's user avatar
  • 108
0 votes
2 answers
64 views

I am attempting to create a game where objects (currently circles) are randomly generated within a canvas, and the objects and their positions (plus other info) are stored within an array. The objects ...
BlueClub's user avatar
-1 votes
1 answer
41 views

I Have A Object Called res and i have a variable Called lea need to concatenate for example let lea = "abc"; let res = { abc:'steve' }; console.log(res.lea); So My Output Should Be steve I ...
onizuka's user avatar
0 votes
2 answers
100 views

I need to write a function that returns an array of objects. The function will select the winners based on two factors: how much they paid, and their seat number. If both of these numbers are odd, the ...
Neet's user avatar
  • 11
0 votes
1 answer
200 views

I have been trying to extract filtered data from my "PMs" table in my excel, I need to filter column D for statuses that are equal to "WSCH" or "WAPPR" or "INPRG&...
AmazingBand Proyect's's user avatar
0 votes
1 answer
19 views

How to convert HTML language to APP language I tried to convert IN VS Code. It did not work. VS code is text editor and VS Code doesnot support app language. Donot tried in other text editor. This ...
user25054299's user avatar
1 vote
1 answer
40 views

I am in the process of refactoring a js file in which I used the THREE.js library to draw a truck visualization based on the parameters provided in the form. The code worked, but I need to extend it ...
Tomek Burzyński's user avatar
1 vote
2 answers
75 views

so I am building a function that will change the background color of a website I am browsing, but when I click on the change color button, it only changes the background color of the popup.html, not ...
Jack Bahjat's user avatar
0 votes
2 answers
97 views

Is it possible to extract an Object out of a Function with JavaScript? The function I received inside of an Object: function item(){ let product = { name: name, price: price } } I want to extract the ...
MArt's user avatar
  • 13
1 vote
1 answer
84 views

The objects I defined in page script seem not accessible in content script for an extension. But the two scripts do share some variables such as window, document, etc. Is there a way to expose some ...
William's user avatar
  • 978

1
2 3 4 5
144