Category: javascript
Make three rectangles (Div or Span containers) as shown in the above figure. Clicking on any rectangle should display (using alert is fine) the name of the rectangle. Three …
A complete binary tree is a binary tree that each level except possibiliy the last level, is completed filled. Suppose you are giving a binary tree represented as an …
Let’s say, if we want to expand strings that contain dynamic variables, we can use regular expression to do this easily. const varContent = { VAR: "World", } console.log(expand("Hello, …
A Leap year occurs mostly every 4 years, but every 100 years, we skip a leap year, unless it is divisible by 400. Leap Year Algorithm if (year is …
Let’s say, we have an array in Javascript, and we want to group the elements, ount their occurences and store the final results in a key-value dictionary. Input Array: …