Skip to content

Tag: javascript

for..in loop & Object.keys different behavior

I have this object function constructor: and I have this instance When I use for loop to iterate over the square object I can see that the iteration process is being happen over the prototype of the square object but when I use the Object.keys() function I can see that the iteration process is not iterating o…

Showing dates on HTML on option select

I am working on an HTML file that has a drop-down list of months. When I select a month, I want the function to show the dates of the month on the page in this format: 1st of December 2020 2nd of December 2020 . . . 31st of December 2020 Below is my html: I cannot get the function

d3js mask to show dots over bar chart

i saw this example here: https://jsfiddle.net/gruc1vod/4/ and i want to add these dots over my bar chart using mask. Here is my JavaScript code: Here is my CSS code: and here my live example: https://jsfiddle.net/uao5yfhm/6/ Where is the problem and i cannot see this outcome correct outcome but i see this one…

Why eslint throw that error, and how can I get rid of it?

I wrote a function to return sessionStorage data and eslint throw error correlated with the return statement in an arrow function Expected to return a value at the end of arrow function consistent-return Answer This is pretty simple, ESLint is telling you that the functions might exit without returning, in yo…

Using Javascript to block element send to next line [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 2 years ago. Improve this question I hav…