In this article, we will discuss debouncing and throttling techniques that can not only enhance the performance of your website, but also prevent unnecessary API calls and load on the server.
Debouncing and throttling techniques are used to limit the number of times a function can execute. Generally, how many times or when a function will be executed is decided by the developer. But in some cases, developers give this ability to the users. Now, it is up to the user to decide when and how many times to execute that function.
For instance, functions attached to events like
With each passing day, new technologies are bridging the gap between web apps and native apps (apps that are installed on your device like WhatsApp). One such example is Progressive Web Applications that have added many native app-like features to the web like push notifications. In this article, we will discuss Web Share API which allows web apps to use the same share dialog box that a native app uses to share content.
Web Share APIs were first introduced in Chrome 61 for Android so that the users can use the devices’ native capabilities to share web apps. At present…
setTimeoutfunction internal working
A wonderful explanation regarding Progressive Web Apps. Thanks Ankita Masand for sharing this article.
Object.create method accepts two arguments as:
prototypeObject: Newly created object’s prototype object. It has to be an object or
propertiesObject: Properties of the new object. This argument is optional
Create an object with Object.create with no prototype
List comprehensions are used for creating new lists from other iterables.
As list comprehensions return lists, they consist of brackets containing the expression, which is executed for each element along with the for loop to iterate over each element.
This is the basic syntax:
new_list = [expression for_loop_one_or_more conditions]
For example, find the squares of a number using the for loop:
Finding squares using list comprehensions:
Here, square brackets signify that the output is a
n**2 is the expression executed for each element and
for n in numbers is used to iterate over each element. …
In this article, we will have a detailed discussion on function and class decorators in Python. We will begin with understanding functions in Python and later with the help of examples, we will understand the internal working of decorators.
In Python, everything is an object. Not only complex datatypes like
dict but even simple data types like
float, etc are objects in Python. Functions in Python are also objects. They are considered as the first-class object.
First-class objects in a programming language are entities that behave just like normal objects. They can be referenced by variables, stored…
In this post, we will discuss what is virtual DOM, how it has helped ReactJS in making DOM manipulation efficient.
ReactJS does not update the real DOM directly but it updates the Virtual DOM. DOM stands for Document Object Model. As per w3.org DOM defines the logical structure of documents and the way a document is accessed and manipulated.
This causes a great performance benefit for ReactJS. Here, we will try to understand why updating the real DOM is slow and how updating Virtual DOM increase the performance?
Why updating Real DOM is slow:
Updating a DOM is not slow…
Lists in Python can be concatenated in two ways
list_b be defined as below
list_a = [1, 2, 3, 4]
list_b = [5, 6, 7, 8]
+ operator to concatenate two
list_c = list_a + lis_b
print list_c # Output: [1, 2, 3, 4, 5, 6, 7, 8]
If we do not want a new list i.e.
list_a = list_a + list_b
print list_a # Output: [1, 2, 3, 4, 5, 6, 7, 8]
extend operator can be used to concatenate one list into another…
Backend Developer | Freelance Blogger