Asynchronous programming is fairly common in javascript network programming. In this approach, we can download, or perform some time-dependent jobs without locking thecurrent execution flow. Which performs asynchronously as compared to our program, which can be done using async functions in javascript. In this article, we will discuss the techniques to return the response from an asynchronous call in javascript. Before entering into the concept, let us see in which cases it becomes confusing to developers when asynchronous execution calls are taken into action. Let us see the following situation. Syntax function aTrivialFunction() { ajaxCall(..., function onSuccess(result) ... Read More
Multiple-inheritance is not supported by Javascript by default. But sometimes we need to mix multiple object properties into a single object. Object property sharing can be done using mixins. In this article, we shall cover what are mixins in JavaScript. The definition of mixins can be stated as mixins is a class that contains methods that can be used by other classes without inheriting from that class. The methods in mixin provide certain behavior which is not used alone but can be used to add these behaviors to other classes. Mixin: A Simple Example See the following example where we ... Read More
While writing code, we always try to make our code easier to read, less complex, more efficient, and smaller in size. For that, we follow several methodologies which make our code efficient. In this article, we shall focus on some techniques based on Javascript sets to perform certain array-like or collection-based applications which will run faster and the code will also be concise. Let us focus few use cases. How sets are different than arrays and the benefits of using sets over an array Arrays are indexed collections where each element is associated with a specific index. On the other ... Read More
In javascript, we may use some sets to hold a few objects. Sometimes we want to check whether an element is present inside a set or not. In this article, we will see different techniques to check whether an element is inside a given set or not.p> A trivial method using for loop At first, we can search for an element by manually picking an element and checking whether it is the same as the key element or not. If so then simply return true, otherwise after completing all elements return false. Examples HTML ... Read More
Handling asynchronous tasks is essential for network programming. In JavaScript most cases, we ask for data that are not synchronous to our system. To handle asynchronous systems, we can use Async and Await functions in JavaScript. The async keyword which is used with a function will qualify a javascript function as an asynchronous function. Async Function The async functions are very similar to the normal functions in javascript. The syntax is like below− From the syntax, it is clear that only the ‘async’ keyword is added to the function signature. Syntax async function name(param1, param2, ...paramN) { ... Read More
JavaScript is a partially object-oriented language. To work with this, the object-oriented nature needs to be understood. In this article, we are going to focus on the multiple inheritance concept inside JavaScript. An object can be inherited from multiple other objects, i.e. the object has common property from other parent objects not only a single parent. In JavaScript, this can be achieved by merging properties from different properties into one single object. Let us see the overall syntax which represents how multiple properties can be merged. SyntaxLet us consider a function syntax like the below − function multiple(...arguments) { ... Read More
Method or function chaining is a popular method in JavaScript that is used to write more concise and readable code. In this article, we shall discuss the method of chaining tactics in JavaScript and also discuss how it works In some JavaScript programs written with JQuery or some other packages, sometimes we call multiple functions one after another on the same line. This can be explained by a simple example as shown below − Syntax ob = ob.method_1().method_2().(some more methods).method_n() Example Without using the method of chaining. HTML Console ... Read More
A Malware is a malicious program that is used by attackers to perform illegal operations on a user's machine, such as stealing personal information, corrupting system/network, encrypting data for "ransom" or deleting the data, etc.An Adware is a program that displays Ads during its execution. Developers get money from this advertisement. This application may capture user activity and display ads accordingly. An attacker can misuse this feature of adware and can compromise the system security.Read through this article to find out more about Malware and Adware and how they are different from each other.What is a Malware?Malware is any program ... Read More
Both these terms "cybersecurity" and "network security" are related to security measures that organizations employ to protect their data, systems, and network infrastructure from online threats. However, cybersecurity is used in a much broader sense, while network security is a subset of cybersecurity. Read through this article to find out more about cybersecurity and network security and how they are different from each other.What is Cybersecurity?Cyber security refers to the use of technology, methods, and policies to reduce the danger of cyber-attacks while also protecting the systems, networks, programs, devices, and data from unwanted access.The field of cybersecurity is becoming ... Read More
When we surf the Internet, a two-way communication takes place between our web browser (client) and a web server (server). To regulate this communication, there are some protocols among which the most common one is the HTTP protocol, where the browser sends an HTTP request to the server and then the server returns an HTTP response to the browser.On the basis of the type of response sent to the browser, we can classify the webpages into two categories: Static webpage and Dynamic webpage.Read through this article to find out more static and dynamic webpages and how they are different from ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP