All Questions
Tagged with iteration javascript
968
questions
-1
votes
1
answer
51
views
Javascript : Find node value through recursive iteration
I have the following structure :
var content = {
"id": "RkktMTA1OC0wNTE3QElNQi82NTAwNC9YLzAwSDc",
"name": "FI-1058-0517",
"category": &...
-2
votes
0
answers
22
views
Object Not Updating Inside FOR Loop [duplicate]
Can someone please explain why this object is not being updated? This has been annoying me for more than an hour. When I run the code on this website: https://playcode.io/1919282, the fillcolor is the ...
0
votes
2
answers
38
views
How to validate JSON response using JSON test data file?
Having JSON response with nested elements. I would like to validate it against JSON test data using Postman and test functions.
For the moment I can easily reach it by hardcoding:
const jsonData = pm....
0
votes
0
answers
48
views
Iterating a Landsat image collection to display as a layer in google earth engine
I am working with Landsat 8/9 in Google Earth Engine (GEE) and would like some help. I have a list of Landsat images and want to do dNBR calculations to each of them and later displaying each as a ...
1
vote
2
answers
60
views
sum up property values when id matches and return the result using javascript
I am trying to achieve a pretty complex iteration but havent been successful so far using reduce. Here is a small example of it
The input is as follows
let input = {
"data": [
{
...
0
votes
3
answers
65
views
group array of object with common ids and concatenate their other properties using javascript
I am trying to achieve a pretty complex iteration but havent been successful so far using reduce. Here is a small example of it
The input is as follows
let input = {
"data": [
{
...
0
votes
4
answers
80
views
how can I recursively iterate through an array of objects and get a new array with filtered data as a result
[
{
"id": "11ed-a261-0242ac120002",
"name": "Languages",
"code": 1,
"description": "Here you can find ...
-1
votes
1
answer
117
views
Explain Javascript array iteration methods?
To perform a performance test for JavaScript's built-in higher-order functions for map, filter, find, you can use the performance.now() method to measure the time it takes to execute each operation. ...
0
votes
2
answers
90
views
How do I make an infinite while loop in JavaScript?
So I wanted to make a simple effect of snowflakes falling from the sky randomly. I can make them all fall at the same time with different velocities, but i cant seem to call for a while loop again ...
0
votes
0
answers
34
views
Scope of 'let' inside loop for creating closure [duplicate]
I am learning Javascript Closures and I have this code
const functions = []
const createFunctions = () => {
for(let i = 0; i < 3; i++)
functions.push(() => console.log(i))
}
...
0
votes
4
answers
85
views
Iterating array of objects and joining the key values with commas
I have an array of objects containing addresses like this:
let addressArray = [
{
street: '123 Charm St',
city: 'Tuscaloosa',
state: 'AL'
},
{
street: '456 Hampton Ave',
city:...
0
votes
1
answer
57
views
why my for loop is not working on ngOnInit?
I'm trying to do a for loop inside a for loop to access an array inside a object that is inside an array of objects, and put them into a new array.
My problemn is that the first loop works but the ...
0
votes
1
answer
103
views
Javascript learning 2nd iteration of if for loop - School work
Updated: Halfway Solved:
I was able to solve the main function of getting the start variables to reach the end nodes. I am lost again on how to track the path i took and and it to console log or a ...
0
votes
2
answers
59
views
Iteration and function sequence in Javascript
This is a true or false quiz. I need the score for the final answer to be updated before the alerts display either the winning or losing alerts.
The below code results in 9 of the 10 scores being ...
-1
votes
1
answer
32
views
Need help iterating through a class to update scores in a JS true or false game [closed]
I'm building a true or false game in JavaScript and the scoring works by changing each of the 10 score elements either green or red for a correct or incorrect answer. These score elements are divs ...