- Javascript Fundamentals Part 1
Javascript is case-sensitive Everything in JavaScript including variables , function names, class names, and operators are case-sensitive. It means that counter and Counter variables are different. Comments JavaScript supports both single-line (//) and block(/**/) comments. // This is a single line…
- Javascript Storage
Cookies An http cookie AKA web cookie, AKA browser cookie is a small piece of data stored in a text file that a server sends to the user’s web browser. The browser may store it and send it back with later requests to the same server. Typically, it’s used to tell if two requests came […]
- Javascript Timing
Timing JavaScript code can be executed in time-intervals either by set a timeout and then execute a funciton or set an interval and then execute a function repeatedly. setTimeout(function, milliseconds) // wait 3 seconds and then execute function let timeout = setTimeout(function(){…
- Javascript this keyword
The this keyword references the object of which the function is a property. In other words, the this references the object that is currently calling the function. When this is used alone, the owner is the Global object, so this refers to the Global object. In a browser window the Global object is…
- Javascript Promise
The Promise object represents the eventual completion (or failure) of an asynchronous operation and its resulting value. A Promise is a proxy for a value not necessarily known when the promise is created. It allows you to associate handlers with an asynchronous action’s eventual success value or…
- Javascript Interaction Functions
Alert function The alert() method displays an alert box with a specified message and an OK button. An alert box is often used if you want to make sure information comes through to the user.The alert box takes the focus away from the current window, and forces the browser to read the message. Do not…
- Javascript Arrays
JavaScript arrays are used to store multiple values in a single variable. If you have a list of names, storing the names in single variables look like this. var name1 = “Folau”; var name2 = “Kinga”; var name3 = “Laulau”; var name4 = “Tonga”; var name5 = “Isi”; However, what if you want to loop […]
- Javascript String
JavaScript strings are primitive values. JavaScript strings are also immutable. It means that if you process a string, you will always get a new string. The original string doesn’t change. Strings are used for storing and manipulating text. To create a string, you can use single quote or double…
- Javascript Callback Function
A callback function is a function passed into another function as an argument, which is then invoked inside that function at a later time. JavaScript statements are executed line by line. However, with effects, the next line of code can be run even though the effect is not finished. This can create…
- Javascript Introduction
Javascript was created to make web pages responsive. With Javascript you’ll be able to create reponsive web pages, games, animated 2D and 3D graphics, comprehensive database-driven apps, and much more. Today, JavaScript can execute not only in the browser, but also on the server, or actually on any…
- Javascript Module
JavaScript programs start off pretty small almost every time. Not until your project grows and grows so large that your scripts may start to look like spaghetti code. At this point, your code has to be broken down into separate modules that can be imported where needed. The good news is that modern…
- Javascript Debugging
Programming code might contain syntax errors, or logical errors. Many of these errors are difficult to diagnose. Often, when programming code contains errors, nothing will happen. There are no error messages, and you will get no indications where to search for errors. Searching for (and fixing)…
- Javascript Runtime
Call Stack JavaScript engine uses a call stack to manage execution contexts : the Global Execution Context and Function Execution Contexts. The call stack works based on the LIFO principle i.e., last-in-first-out. When you execute a script, the JavaScript engine creates a Global Execution Context…
- Javascript Network Request
Fetch API The Fetch API is a modern interface that allows you to make HTTP requests to servers from web browsers. The Fetch API is much simpler and cleaner. It uses the promise to deliver more flexible features to make requests to servers from the web browsers. The fetch() method is available in…
- Javascript Error Handling
No matter how great we are at programming, sometimes our code has errors. They may occur because of our mistakes, an unexpected user input, an erroneous server response, and for a thousand other reasons. Javascript has try and catch to handle these errors and respond to users. try { let name =…
- Javascript Date
Create a date object By default, Date uses the browser’s time zone and display a date as a full text string: Tue Oct 27 2020 22:52:28 GMT-0600 (Mountain Daylight Time) new Date() new Date(year, month, day, hours, minutes, seconds, milliseconds) new Date(milliseconds) new Date(date string) new…
- Javascript Objects
An object is a collection of properties , defined as a key-value pair. Each property has a key and a value. The property key can be a string and the property value can be any valid value. Create an object You can use {} or the new Object(). let object = {} object.name = “Folau”; object.age […]
- Javascript Class
Classes are a template for creating objects. They encapsulate data with code to work on that data. You first need to declare your class and then access it, otherwise code like the following will throw a ReferenceError. /* * Classes are a template for creating objects. They encapsulate data with…
- Javascript Functions
A function is a block of code designed to perform a certain task. A function is run when it’s invoked or called by an action. functions are very important because they are written once and can be executed multiple times. They save you a lot of development time in that you don’t have to repeat […]