Skip to main content

Posts

Learn HTML in Hindi - 1st lesson.

अधिकांश HTML तत्वों में एक प्रारंभिक टैग और एक समापन टैग होता है। उद्घाटन टैग इस तरह दिखते हैं: <H1> बंद टैग इस तरह दिखते हैं: </ H1> उद्घाटन और समापन टैग के बीच एकमात्र अंतर एक समापन टैग के उद्घाटन ब्रैकेट के बाद आगे की स्लैश है।  
Recent posts

constant variable

"कॉन्स्ट" का उपयोग करने से आप वैरिएबल को परिभाषित कर सकते हैं जिसे नए मूल्यों को नहीं सौंपा जा सकता। आदिम मूल्यों के लिए, जैसे कि स्ट्रिंग और संख्या, आप मान को बदल नहीं सकते हैं, एक बार जब आप इसे "कॉन्स्ट" का उपयोग करके घोषित करते हैं।  

Learn JavaScript - Introduction

JavaScript program is made up with series of statements and each statement ends with a new line or semicolon. Its not compulsory to terminate a statement with semicolon as JavaScript interpreter use a process called Automatic Semicolon Insertion(ASI). This process will attempt to place semicolons at the end of the line for you. But, it is best practice to write statement in a new line and terminate by a semi-colon. # JavaScript # beginner # tutorial

Learn JavaScript - Comment

If you want to learn programming languages, first you should learn how to write comment in the chosen language. Comments are ignored by the language compiler or interpreter but they are not ignored by yourself or other human beings. So comments are really important and make you productive as well as other person who want to update or correct your code. Writing comments make you a better programmer. There are two ways of writing comment in JavaScript. 1. Single line comment starting with // and finishing at the end of the line.  2. Multi line comment spanning more than one line starting with /* and finishing with */

What is asynchronous programming, and why is it important in JavaScript?

Synchronous programming means that, barring conditionals and function calls, code is executed sequentially from top-to-bottom, blocking on long-running tasks such as network requests and disk I/O. Asynchronous programming means that the engine runs in an event loop. When a blocking operation is needed, the request is started, and the code keeps running without blocking for the result. When the response is ready, an interrupt is fired, which causes an event handler to be run, where the control flow continues. In this way, a single program thread can handle many concurrent operations. User interfaces are asynchronous by nature, and spend most of their time waiting for user input to interrupt the event loop and trigger event handlers. Node is asynchronous by default, meaning that the server works in much the same way, waiting in a loop for a network request, and accepting more incoming requests while the first one is being handled. This is important in JavaScript...

What are the pros and cons of functional programming vs object-oriented programming?

OOP Pros: It’s easy to understand the basic concept of objects and easy to interpret the meaning of method calls. OOP tends to use an imperative style rather than a declarative style, which reads like a straight-forward set of instructions for the computer to follow. OOP Cons: OOP Typically depends on shared state. Objects and behaviors are typically tacked together on the same entity, which may be accessed at random by any number of functions with non-deterministic order, which may lead to undesirable behavior such as race conditions. FP Pros: Using the functional paradigm, programmers avoid any shared state or side-effects, which eliminates bugs caused by multiple functions competing for the same resources. With features such as the availability of point-free style (aka tacit programming), functions tend to be radically simplified and easily recomposed for more generally reusable code compared to OOP. FP also tends to favor declarative and denotational styles...

What is the difference between classical inheritance and prototypal inheritance?

Class Inheritance: instances inherit from classes (like a blueprint — a description of the class), and create sub-class relationships: hierarchical class taxonomies. Instances are typically instantiated via constructor functions with the `new` keyword. Class inheritance may or may not use the `class` keyword from ES6. Prototypal Inheritance: instances inherit directly from other objects. Instances are typically instantiated via factory functions or `Object.create()`. Instances may be composed from many different objects, allowing for easy selective inheritance.