All Questions
51 questions
0
votes
1
answer
46
views
This code changing the image as expected but not the id?
const currentTypesResult = [{
id: '155',
foodId: '511555522559744444',
image: 'Some image string',
example: 'example'
}]
const processedResults = currentTypesResult.map((item) => {
...
0
votes
1
answer
45
views
I'm trying to get the Highest sum in JS , but I keep running into this error
I'm trying to get the highest sum, but I keep running into this error
"for(let i = 1; i < nums.length; i++) { ^ TypeError: Cannot read properties of undefined (reading 'length')&...
-1
votes
3
answers
393
views
Button icon switch (class attribute)? [duplicate]
Kinda new to this, why is this not working?
I created 2 buttons which are a play button icon and an arrow down icon.
The buttons should switch on click to different ones by changing the "class&...
6
votes
2
answers
630
views
Correct video not playing when button 3 is clicked
How would this be debugged and fixed?
I am finding the code incredibly difficult to debug.
How would this issue be fixed in the code?
I want the code to work how it works in the demo code: https://...
-2
votes
1
answer
57
views
Why I get undefined in last element
Why do I get undefined in the last element when I distribute the colors in elements?
The work of code mixed colors in rows
I try to set named colors in the circle without repeating the same color and ...
0
votes
0
answers
30
views
Javascript in Adobe DC
I created a list box with a long list of options. However, I would only like the selected options to appear on the printed document.
Can somebody help me correct this code?
try {
// assume value is ...
0
votes
1
answer
2k
views
Uncaught type error cannot read properties of null (reading 'push')
I have an Issue,I was working on a Contact app where I used local storage b4 I recently changed pc and transfered my vscode folders to new Pc,but I am getting uncaught error type cannot read ...
0
votes
2
answers
408
views
Sum without highest and lowest number
I've been spending a few hours trying to understand where the error is in this code. Debugging indicated that the output is 0 as it should be for any number less than 0. However, this code is still ...
-1
votes
1
answer
35
views
Is there any leak in my code, Only 1 case isn't working I don't know why?
I am trying to write a programme to move all the zeroes at the end of the array and retain and the original order of other elements.
Here is my code:-
var moveZeros = function (arr) {
// TODO: ...
1
vote
1
answer
964
views
How to change the value of the index number of an array so that it would start from 1 instead of 0
How do i make it so that the index starts with 1 instead of 0. Also how would i make it 1st, 2ed, 3rd etc. in instead on 1 2 3 etc.
<p id = "array"></p>
<script&...
-1
votes
1
answer
266
views
Array is iterable on local machine, but not on Leetcode?
I'm solving this this leetcode problem (letter combinations found in phone number), and the solution seems to work on my machine, in vscode. Here is the code I am running, under the sample input of '...
-1
votes
2
answers
302
views
indexOf gives false positives
I made a function to search words in a string given. The function called str_find receives the word and then the parameters to search. These parameters can be an array with strings or only a string.
...
-1
votes
1
answer
153
views
Tried to get data from a form and append it to a global array, but for some reason the data isn't being added
I am trying to get data from a form and append it to a global array but for some reason, the data isn't being added to the array. The code should basically accept the input from the form and store it ...
0
votes
2
answers
188
views
React: Button click not writing to console
I have a button and for testing purposes, I want to write to the console the index of an array element. More specifically, I have a button in button.js, and that button is displayed on each array ...
0
votes
2
answers
854
views
Why is array seemingly empty after the loop? [duplicate]
function par(idF, idM) {
this.IDOvna = idM;
this.IDOvce = idF;
}
function breeding() {
let idOvce = [];
let brOvce = [];
let mesecOvce = [];
let godinaOvce = [];
let istorija1 = [];
...