Why is my list not created in javascript?

I have an object with 4 properties that i want to make to a list using only JS. Could someone help me to see what is wrong with my code? And in the long run i want to have a function that when a user select one of the categories it randomly chooses a value.… Read More Why is my list not created in javascript?

Is it possible to add an eventListener in a for loop, if so, how would you implement it?

For me For Loops and ForEach Loops are two of the best ways to handle and display large data. The issue is I want to add an eventListener to a loop and you immediately run into issues. Here is my code, it loops through an API Provided Array and creates HTML Divs perfectly. Near the… Read More Is it possible to add an eventListener in a for loop, if so, how would you implement it?

React Js Components imported but not displaying

I have two components ‘footer’ and ‘header’ in the components directory. It imports properly but I am not able to display it. App.js import header from "./components/header"; import footer from "./components/footer"; function App() { return ( <> <header /> <main> <h1>Welcome to Proshop</h1> </main> <footer /> </> ) } export default App; header.js import React… Read More React Js Components imported but not displaying

Dynamic render react child component

How can i dynamic render react child component? Now that looks like this and its works. <CustomFieldArea> {(ExampleCustomFields || []).map((e: { field: string; CustomComponent: ‘Text’ | ‘TextArea’ }) => { if (e?.CustomComponent === ‘Text’) { return ( <CustomFieldArea.Text name={e?.field} /> ) } if (e?.CustomComponent === ‘TextArea’) { return ( <CustomFieldArea.TextArea name={e?.field} /> ) } })}… Read More Dynamic render react child component

Can I reduce this 3 functions to only one and create 3 distincts things?

These functions will create divs, and A, B, and C will have different left positions (as in the arrays) and different classes with different dimensions. Another function will call them in a set interval and will decrease all the "–bottom" with time at the same speed (they will move down ). I have a feeling… Read More Can I reduce this 3 functions to only one and create 3 distincts things?

javascript data not appending to html webpage?

I have this simple code with 5 paramaters taken from an API that logs data: for (i = 0; i < arr.length-1; i++) { console.log(‘For Calls’) console.log(arr[i].league.name) console.log(arr[i].teams.home.name, arr[i].goals.home) console.log(arr[i].teams.away.name, arr[i].goals.away) } it logs this data to the console (2 sets of data shown): Logged Data The issue I am having is trying to display… Read More javascript data not appending to html webpage?