Best Solutions With Guaranteed Results

WordPress has transitioned into the most relevant CMS (content management system) over the years. It’s the go-to platform for most serious businesses setting up a functioning website or blog page. In the olden days of the Internet, creating a website required a strong coding and HTML knowledge base. That has changed with the creation of CMS. CMS software allows you to build websites without the hassle of writing codes.

But what makes WordPress special is the plethora of integrations and customizations that are available to users. WordPress allows a digital creator to go all out with their vision. …


Understanding the core difference between these React hooks

We all must be familiar with using React hooks. But have you ever wondered when should you use the useEffect hook and the useLayoutEffect hook? In this article, I’ll explain the use cases for the right usage for each of these hooks.

Actually, both of these hooks basically do the same thing, but they have slightly different use cases. But before moving into these differences, let’s first understand a few terminologies.

  • Render — means computing the styles for each DOM node.
  • Paint — means the content is displayed/updated on the screen.

useEffect

Most of the time, you might want to use…


You Might Have Not Come Across These

In this article, I gathered some JavaScript tricks that I believe can make you a better JavaScript developer. In no particular order, here are eight JavaScript tricks for you!

1. Swapping two variables

There is a one-liner to swap two variables in JavaScript and here it is:

let first = 'hello', last = 'bye';
[first, last] = [last, first];
// first = 'bye', last = 'hello'

The above code creates an array of [last, first] and immediately destructures them into the opposite variables.

So there is no need for temporary variables anymore!

2. Remove array duplicates

You don’t have to loop through the array, use a map and…


How to Create a Custom Hook for using Axios

In almost every front-end applications we make API calls. Two most popular ways of making HTTP requests are either by using Fetch API or Axios library. If you have not read my comparison on Axios Vs Fetch, please do check it out.

In this article, I’ll explain how to write a custom hook for Axios in React. By following this method, we can avoid repetition of the code in multiple places. Here are the following steps to implement it.

1. Make an API call in the component

Generally, all the APIs of an application have the same base URL. Here let’s set up our base URL for Axios…


Here’s Why Axios Is Way Better

Being a developer, there are often times when there are so many options, packages, and paths to follow and choose from. For example, when we are making HTTP requests, which way should we choose? In this article, I will cover the Axios library and the Fetch API and showcase their differences.

What are they?

When we want to communicate with servers through the HTTP protocol, we send out requests and the data is fetched — this process is famously called AJAX (Asynchronous JavaScript And XML). …


10 Ways To Write Better JavaScript Code

Most of us are used to writing JavaScript code for a long time. But we might not have updated ourselves with new features which can solve your issues with minimal code. These techniques can help you write clean and optimized JavaScript Code. Today, I’ll be summarizing some optimized JavaScript code snippets which can help you develop your skills.

1. Shorthand for if with multiple || conditions

if (fruit === 'apple' || fruit === 'orange' || fruit === 'banana' || fruit ==='grapes') {
//code
}

Instead of using multiple || (OR) conditions, we can use an array with the values and use the includes() method.

if (['apple', 'orange', 'banana'…


NoSQL, SQL, NewSQL — HarperDB has it all

Are you looking for the right database for your product? Are you confused if you should pick SQL or NoSQL? What if there is a product that has the best of both worlds? What’s that product you ask? — It’s HarperDB.

Why was I fascinated by HarperDB?

For someone who had learned SQL all my life and mostly worked with only SQL solutions, it was initially tough to get my head around MongoDB. Call me old school, but despite its advantages, I’ve always wondered why read operations were expensive if there are ways to avoid duplication if there were easier ways to get data from complex…


Guidelines to Become a Better Developer

As a beginner, we try to get our code to work first but as we try to become a pro we should be wary of writing clean and efficient code. Writing clean code comes with a lot of practice and it’s a skill that every JavaScript developer must master. In this article, I will share with you a bunch of tips that will help you improve these skills in JavaScript.

1. Use includes() to avoid multiples checking

Having multiple ORs (||) and ANDs (&&) inside your if conditions can make your code look quite messy. So, try and avoid them if and when you can. Here’s a…


Did you hear about the recent Sudo vulnerability bug that was discovered? You might have because it was a recent sensation — CVE-2021–3156. This is a new severe bug that could affect Linux and Unix operating systems, it also affects MacOS. This bug could potentially allow root privileges without authentication for any unprivileged user — yes, it’s that severe.

This vulnerability is perhaps the most significant sudo vulnerability in recent memory (both in terms of scope and impact) and has been hiding in plain sight for nearly 10 years” said Mehul Revankar, Vice President Product Management and Engineering, Qualys, VMDR…


Food for your JavaScript thoughts

JavaScript is a beautiful language that has its own secrets that many of us would be surprised about. Even though there’s something new that we learn about it every single day, it never ceases to surprise us. Here’s a collection of a few well-kept secrets of JavaScript.

1. NaN is a number

Did you know NaN was a number? Yes, that’s right! Not a Number (NaN) is apparently a Number.

console.log(typeof NaN); //number

Also, NaN is not even equal to itself and it’s not equal to any other object. If you’ll have to check if anything is NaN at all, you need to use isNaN()

Harsha Vardhan

Engineer, Photographer, Tech Blogger. Builds products and writes for developers. I love to code and love to help others code :)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store