Skip to main content
Anand Techie
Software Developer, Frontend
View all authors

Understanding and Resolving CORS Error

· 5 min read
Anand Techie
Software Developer, Frontend

What is CORS and CORS preflight?

Cross-Origin Resource Sharing (CORS) is an HTTP-based security mechanism controlled and enforced by the client (web browser) that allows controlled access to resources located outside of a given domain.

Generally, for security reasons, browsers forbid requests that come in from cross-domain sources. However, there could be cases where you want to overcome this and access cross-domain resources, and CORS makes this possible.

JS Regex Helper

· 9 min read
Anand Techie
Software Developer, Frontend

A regular expression , also known as regex or regexp , is a sequence of characters that define a search pattern. It can be used to search, edit, or manipulate text and data.

In JavaScript, regular expressions are created using the RegExp object . The RegExp object has a number of methods that can be used to search for and manipulate strings.

Here are some examples of regular expressions in JavaScript:

// Find all occurrences of the letter "a" in a string
const regex = /a/g;
const string = "This is a string.";
const matches = regex.exec(string);

// Replace all occurrences of the letter "a" with the letter "e" in a string
const regex = /a/g;
const string = "This is a string.";
const newString = string.replace(regex, "e");

// Check if a string contains a particular pattern
const regex = /^abc/g;
const string = "abc123";
const match = regex.test(string);

Which came first?

· One min read
Anand Raja
Senior Software Engineer
Anand Techie
Software Developer, Frontend

You've heard the age-old riddle: "Which came first: the chicken or the egg?" Taken metaphorically, it's a meditation on the futility of determining the cause of a self-perpetuating cycle. Taken literally, it's a great question for evolutionary biologists.

Chickens come from eggs, but eggs come from chickens. So which came first?