Skip to content

Tag: javascript

How to find biggest number in array around undefined elements?

My question is pretty simple actually but I couldnt find satisfied answer lets say that I have array like above.And I wanna get the max value in array which is 20. this is what I did but returned undefined so I tried something like that below and worked but filtering all undefined elements(iterating all) and …

Donut chart d3.js labels

I’m new to d3.js and I’m trying to change this code. What I actually need is to have each slice’s name on it. The problem is that labels need to change for each button. For example, if you click on culture/Media the labels are – German, English, History but for medicine are – Den…

how to add delay in javascript

I want to add red class after 6 secs.I tried like using setTimeout but not work.could you please suggest the better way ? I want to write a delay function which delay for sometime before proceeding/executing next code. Answer You can make a very simple queue of tasks to be executed based off promises. Since t…