Short-Circuiting in JavaScriptWe have always used boolean operands up until now when we work with logical operators. In javascript, we can make use of non-boolean values as well with logical operators(&&, || ) which is known as short-circuiting. Let's have a look at short-circui...Jun 14, 2022 · 4 min readvarun19.hashnode.dev
The Spread Operator in Javascript.The spread operator is a new addition to a set of operators in Javascript ES6. It is denoted by three dots and basically unpacks elements of iterable objects such as arrays, sets, and maps. Let's have a look at how the spread operator can be useful L...Jun 11, 2022 · 3 min readvarun19.hashnode.dev
What is type coercion in javascript and how is it different from type conversion?First, let us start easy by taking a look at type conversion. In type conversion, we are explicitly mentioning the data type we want the variable holding the value to be converted to. Let us look at a few examples of type conversion const inputYear =...Jan 2, 2022 · 4 min readvarun19.hashnode.dev
String methods in JavascriptStrings in Javascript consist of many methods and these methods help you to work with strings. String length method The string length property fetches us the length of the string. const str = "Hello World"; console.log(str.length); String indexOf() m...Oct 4, 2021 · 4 min readvarun19.hashnode.dev
Advanced attribute selectors.There are several ways of selecting an element with the help of attributes. Albeit normal selectors can be used, in some cases these advanced selectors can help in getting the job done easily. To select an element with an attribute, let's look at a c...Sep 13, 2021 · 2 min readvarun19.hashnode.dev