Skip to content
Advertisement

Json path starting with 0

I’m trying to get the data from a https.get request to an API and the json path has a 0 at the beginning. What does it mean and how do I access the data? The path is 0.length and the json chart viewer throws an error. The data looks like this in json viewer: Answer 0 is index of array,

transfer flat object to nested object (javascript)

i am getting a flat object of cms navigation and want to transfer it to a nested object. The level describes the position of the element in the tree. Whenever there are subelements they should be stored under a new subCategory. In every level could be multiple elements. For example two level 1 categories (“shop service” and “information”). The flat

How to add all filtered elements in an state varaible

i have an array of objects containing users data stored in a state varaible and a table where I am displaying these users. I have a search field where a user can type name and search. Now my question is when a user types i want to search from these names and update the state variable and when user clears

Show rating stars in react not showing any stars

I am building website of Mangas where each Manga has star reviews. I am done with backend but since I am very new to react, I can not figure out how to display stars on webpage. I’m developing it in Django so: id=”{{ rating }}” is a loop where I display each manga with title, rating and so on. console.log(prop.id)

Javascript How to update all Property Names in nested object

I would like to return a new object with the updated property names in the nested object. For example in the fakeData below, I would like to update all the property names from: The data that I am trying to update : So far I’ve tried to use the recurrsion to do this but the subtask are not updating correctly

When click button change text in code tag

I’m trying to make a code box you can see in image . My question is how can ı change code in code tag when click another language button ? Answer You have to put some Javascript code. If click on JavaScript tab, display none PHP tab data and if click on PHP tab, display none the Javascript tab data.

Why functions are not working properly in my calculator?

Can you help me identify where’s the problem with this code? I’m a beginner at coding and very likely I’m missing something obvious, but here’s my problem. When clicking on numbers it seems to work fine, also adding gets to clear the display and (I think) it stores the value in its variable (operandA) but not getting the rest to

Getting odd results from a for loop inside a filter function

I’m looping inside a filter. I want to get the values from my vals array plus the keys(name, description) for my filter. When I iterate through my vals array, I keep getting returned the name but not the key. Ideally I would like the return method to give me key and value. return x[this.searchValues[i]].includes(‘phil’) to be return x.name.includes(‘phil’) return x.decription.includes(‘phil’)

Advertisement