Your test cases should failWriting tests are not enough. If the tests don't fail when a bug is introduced then what's the point of writing tests. Your test should fail when the application doesn't meet the requirements. In this article, we look at an example, then improve its ...Jan 25, 2022 · 3 min readil3ven.hashnode.dev
Easily implement Infinite Scrolling using Intersection Observer in vanilla JavaScriptWhat is infinite scrolling? It is when more items keep loading as we scroll. Below is a GIF for visual representation. View this GIF in action Difficult way to do it (using getBoundingClientRect) Here we are discussing the difficult way in brief. It...Jul 23, 2021 · 4 min readil3ven.hashnode.dev
Pythagorean triplet in an array - Interview QuestionIn the problem of Pythagorean triplet we are given an array of numbers. array = [1, 2, 3, 4, 5] We have to return true if there exists a triplet of (a, b, c) such that a^2^ + b^2^ = c^2^. For example, in the above array the triplet (3, 4, 5) satisfi...Jul 22, 2021 · 6 min readil3ven.hashnode.dev
Common Error: Accidentally Mutating State in ReactIn React, the state is immutable. In simple terms it means that you should not modify it directly. Instead a new object should be created to set the state using setState. Here are two examples. Modifying the state directly - Not Acceptable onChange(e...Jun 12, 2021 · 2 min readil3ven.hashnode.dev