Posts

Showing posts with the label JavaScript

JavaScript - Summary Of JavaScript Lessons

Image
  ●       Introduction ●       Classes, objects and prototype ●       How ‘this’ acts ●       Strict notation ●       Function closure ●       Callbacks and promises   JavaScript By default, JavaScript programs run using a single thread. Though there are ways to create new threads JavaScript is considered a Single-threaded language. JavaScript does not wait for I/O operations to get completed, instead, it continues the execution of the program. This is called non-blocking I/O. JavaScript is asynchronous because of the NIO nature. JavaScript is dynamically typed. It determines variable types, ordering, etc. in runtime. JavaScript supports OOP as well as functional programming (Multi-paradigm). JavaScript has an eventing system that manages its asynchronous operations. Classes and objects ●     ...

JavaScript - Synchronous and Asynchronous

Image
  JavaScript is a single-threaded programming language which means only one thing can happen at a time. That's where asynchronous JavaScript comes into play. Using asynchronous JavaScript (such as callbacks, promises, and async/await), you can perform long network requests without blocking the main thread Synchronous JavaScript:   As the name suggests synchronous means to be in a sequence, i.e. every statement of the code gets executed one by one. So, basically, a statement has to wait for the earlier statement to get executed.   To allow us to understand what  asynchronous  JavaScript is, we ought to start off by making sure we understand what  synchronous  JavaScript is.  A lot of the functionality we have looked at in previous learning area modules is synchronous — you run some code, and the result is returned as soon as the browser can do so.  const btn = document.querySelector('button'); btn....

JavaScript - Data Types and this key word (Part 2)

Image
JavaScript Data types JavaScript Data types one of the most fundamental characteristics of a programming language is the set of data types it supports. These are the type of values that can be represented and manipulated in a programming language.    JavaScript allows you to work with three primitive data types:   Numbers, e.g., 123, 120.50 etc.  Strings of text, e.g. "This text string" etc.  Boolean, e.g. true or false.  JavaScript also defines two trivial data types, null and undefined, each of which defines only a single value. In addition to these primitive data types, JavaScript supports a composite data type known as an object. We will cover objects in detail in a separate chapter. Note: Java does not make a distinction between integer values and floating-point values. All numbers in JavaScript are represented as floating-point values. JavaScript represents numbers using the 64-bit floating-point format defined by the IEEE ...

JavaScript - Introduction (Part 1)

Image
JavaScript - Introduction  JavaScript is a dynamic computer programming language. It is lightweight and most commonly used as a part of web pages, whose implementations allow client-side script to interact with the user and make dynamic pages. It is an interpreted programming language with object-oriented capabilities.  JavaScript was first known as  Live Script,  but  Netscape  changed its name to  JavaScript , possibly because of the excitement being generated by Java. JavaScript made its first appearance in Netscape 2.0 in 1995 with the name Live Script. The general-purpose core of the language has been embedded in Netscape, the Internet Explorer, and other web browsers. JavaScript is a lightweight, interpreted programming language.  Designed for creating network-centric applications. Complementary to and integrated with Java. Complementary to and integrated with HTML. Open and cross-platform.  Modern JavaScript de...