Founder Of Geekstrick. Full-Time Software Developer, Expertise in Frontend Development. Conversant with - Angular, React, NodeJS, and MongoDB, MySQL, Postgres,HTML+CSS+JS, CypressIO.
In the browser cookies is store in string format containing key-value pairs. So, how to parse a browser Cookie string and return an object of all cookie name-value pairs? separate each key-value pair using String.prototype.split(‘;’) Use Array.prototype.map() and String.prototype.split(‘=’) to separate keys from values in each pair. Use Array.prototype.reduce() and decodeURIComponent() to create an object […]
for loop in modern JavaScript is rarely talked about although it’s only useful in asynchronous operation scenarios. But what breaking out early consider the following example: Matching two array const smallArray = [0, 2]; const largeArray = Array.from({ length: 1000 }, (_, i) => i); const areEqual = (a, b) => { let result = […]
The simplest way to create a cookie is to assign a string value to the document.cookie object, for example- document.cookie = “key1 = value1; key2 = value2; expires = date”; // Example var now = new Date(); now.setTime(now.getTime() + 1 * 3600 * 1000); //set cookies to expire in 1 hour document.cookie = `${key} = […]
A callback function is a function that is passed to another function as an argument and is executed after some operation has been completed. for example of a simple callback function that logs to the console after some operations have been completed. function extendArray(arr, callback) { arr.push(100); // then execute the callback function that was […]
Code and Demo This tutorial will see how we can Easily Translate the Angular 12 App Using the library Angular 12 with ngx-translate The internationalization (i18n) library for Angular ngx-translate: It is an internationalization library for Angular. It will let you define translations for your content in different languages and you can switch languages easily. […]
You can do it via regular expression: use the /g (“match globally”) modifier with a regular expression argument to replace if you are assigning a RegExp directly let a = “[email protected]”; a = a.replace(/xxxx-/g, “”); if you want to pass RegExp with some variable let a = “[email protected]”; const code = ‘xxxx’; const key = […]
Yes, Angular JS is a JavaScript framework it was used to develop a web application. Angular JSThis framework has a model-view-controller (MVC) that acts as the central component as it manages data, logic, rules, and expresses how the applications behave. AngularAngular uses components that are directives with templates. There are two kinds of […]
Angular team has announced that the Angular v12 Is Now Released And Available. Below mention are the changes you will find in a newer version of angular. Angular v12: Ivy Everywhere Angular v12 has finally deprecated the View Engine. The community has been working over recent releases towards the goal of converging the Angular ecosystem […]
Flask 2.0 – New Major Version Released. This release will contain some new features such as some shorthand properties for the route, Support async views, callbacks such as error handlers, and better CLI errors. Flask 2.0 Upgradation and Installation Install from PyPI with pip. For example, for Flask: pip install -U Flask Note: Flask 2.0 […]
This tutorial will see how we can Schedule A Cron Job In NodeJS Using the node-cron module. What is a cron job? A cron job is the event schedular that runs a job as per the given time interval. So it executes a file linked which is linked to that particular job, it runs the […]