Skip to main content

All Questions

0 votes
1 answer
106 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 ...
Anon Flexy's user avatar
0 votes
2 answers
68 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 ...
John's user avatar
  • 3
-1 votes
1 answer
30 views

Add to object with every iteration without replacing

I have an object outside of the function that I want to populate with every iteration and call that object after the iteration is done but I am only able to see the last element in my object. How do I ...
nb_nb_nb's user avatar
  • 1,381
0 votes
1 answer
253 views

How can I create a function that check boolean field in array of object javascript

The final goal: if all the field are true the last object.field must change to true const badges = [ { name: "peter", given : true, points: 10 }, { name: "Alice", given : ...
foxDev's user avatar
  • 87
0 votes
4 answers
68 views

Creating an Iterative - Javascipt

I have a recursive function below and I was just wondering how can I create an iterative (i.e. loops without recursion) for the same thing. I would really appreciate any help or suggestions thank you! ...
28space_junkiee's user avatar
0 votes
1 answer
751 views

How to bind to a context if one is passed?

I have written this function, that basically emulates the Underscore.js function of the same name. All is working correctly, except I am struggling to understand how to bind to the context if one is ...
btow54's user avatar
  • 111
1 vote
2 answers
42 views

Why is my basic recursion looping infinitely?

let data = [1, 2, 3] let sorted = [] let push = function(i) { while(i<data.length) { sorted.push(data[i]) push(i + 1) } } push(0) Hey guys, I am writing some basic recursion and it ...
9706437's user avatar
  • 13
0 votes
0 answers
17 views

Unable to access iteration items from nested function calls in JS [duplicate]

I know there are some related posts and I have gone through them, but I have not been able to make my code work. The provided code is a simplified portion of a larger code base. As you can see below, ...
user2217057's user avatar
0 votes
0 answers
40 views

Execute javascript function in only one of multiple modals

Well, here's the thing. I have two modals on my view. The first one called #modal1 and the second one #modal2. I have a function named "a" that executes an "each" iteration that looks like this: ...
Andrew Sunset's user avatar
0 votes
1 answer
57 views

User Input to Make Decisions using Iteration

My code is a version of an old game Mastermind and is supposed to guess my secret code, and if user guesses the right character it prints letter green, if its right character wrong place it prints out ...
Dallas's user avatar
  • 61
2 votes
2 answers
73 views

Arguments for the Seek and Destroy Freecode camp challenge

I'm trying to understand the Seek and Destroy challenge below. Task: You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. ...
Veronica's user avatar
0 votes
3 answers
229 views

returning a function value inside an iterator without exiting in javascript

I am not sure if my title fits my question but here it goes. I have an iterator runs every 1 second and a function that goes like this: function getValue(val) { return val; } function test() { ...
Website Is Fun's user avatar
2 votes
2 answers
1k views

is it possible to assign id name to a variable and use it in a function in javascript

I am creating an html form that will take quantity values in input for items and calculate the individual total cost and show it adjacent to each input box and show the grand total at the bottom of ...
user3526204's user avatar
3 votes
2 answers
1k views

Iterate an array into a custom grid

I have a gird similar with a table with columns and rows but custom created with divs and spans and I want to populate every cell with values from many arrays and is not really working :| so this is ...
mcmwhfy's user avatar
  • 1,686
1 vote
1 answer
172 views

How to convert this recursive function to a iterative one? (var_dump in javascript)

I'm new here and I'm trying to convert a recursive function to iterative. I have been reading about the subject for some days and I have found some good sites that gave me ideas to try. But I couldn'...
Pegasus123's user avatar

15 30 50 per page