All Questions
Tagged with javascript arrays
93,148
questions
0
votes
0
answers
10
views
Manipulate data for Row Span logic in ag grid
I have an ag grid with row spanning and I am able to do row span for first and second column. Can anyone please help me for row span logic for rest of the columns (notes, votes)?
I think row span ...
-2
votes
0
answers
21
views
I can't display values from a javascript function separately through an array or a callback function [duplicate]
I need to retrieve the latitude and longitude coordinates to use them elsewhere. What is the easiest way? Using an Array? Or an callback function?
According to the code snippet below, the console.log(...
0
votes
1
answer
20
views
Can't use variable field of mongodb in javascript
I have retrieved one document from mongodb, in that I have one array and I want to loop through that array but I can't do that. If I loop through that it consider whole array as one element, this is ...
-2
votes
0
answers
28
views
Javascript step by step - returning results based on buttons chosen [closed]
I am looking to mock up a structure up like this:
I presume I can use Javascript to mock up and return the results on the final page (Step 3) by looping through an array of buttons depending on which ...
-1
votes
0
answers
26
views
unexpected token (...) for no reason [closed]
This entire HTML's script code:
[...document.querySelectorAll("input")].forEach(ele => {
ele.addEventListener(
"change", () => {
Main();
}
...
-3
votes
0
answers
50
views
Element children returns "undefined" even though it has a length of 1 or is not empty at all [closed]
so to make it short, I'm looping through all html tags using element.children to check some matched value and I noticed it's not getting into the deepest nested html tags.
I have an element where its ...
-5
votes
0
answers
47
views
TypeError: Cannot read properties of undefined (reading 'map') react.js [closed]
import React, { Component } from 'react';
import Like from '../common/like';
import TableHeader from '../common/tableHeader';
import TableBody from '../common/tableBody';
class MoviesTable extends ...
-5
votes
0
answers
55
views
Do not remove duplicate objects from array while pushing an array into another array [closed]
I have an original array deptWiseAlerts, I am trying to bring out an output array graphData3 as below
[
{
"name": "0-3 Days",
"data": [
{
...
-8
votes
0
answers
28
views
How to get and sort a string from an array in javascript? [closed]
I have this array with this string:
['MEX-CUN'] ['MEX-MTY']
and I would like a result similar to this:
CUNMEX
MEXMTY
Is it possible to perform this action?
0
votes
2
answers
56
views
Find the average per index in a matrix
I'm looking to get the average of each index in a matrix row in JS
[1, 2, 3]
[4, 5, 6]
[7, 8, 9]
Then returning a list with the average of each row index : [4, 5, 6]
Would I create a loop, save each ...
1
vote
0
answers
44
views
Multiple adding to cart in JavaScript doesn't work
when I add products to the shopping cart at some point it stops updating the table, it is refreshed when I click the previous product and the product I want to add.
Live site: https://frontend-mentor-...
-1
votes
3
answers
75
views
Todo list using array and loop
I want to create a todo list using array and loop and display the list in div container. I am able to display the list but it is muliplying the same list stored and is displayed.
<body>
<...
-1
votes
3
answers
43
views
Retrieve array data that every nested array contains
The main goal is to select all the colors that every car.colors contain, if there's no color that every car have then the expected output is an empty array.
Having an array that contains text, and a ...
0
votes
0
answers
19
views
Google Earth Engine: error "Invalid type. Expected type: Number" trying to compute a Number while performing histogram matching on satellite images
I am working on satellite imagery on Google Earth Engine (JavaScript), and I'm experiencing some issues while I try to perform histogram matching on two images from two different time periods.
In ...
-2
votes
0
answers
49
views
Leetcode output is different from visual studio code output [closed]
I just started on my leetcode exercises and I ran into a bit of a problem. I usually work on the leetcode problems on vsc and then when I got my answer, i just copaste it onto the leetcode answer box.
...