Latest Updates

Creating a Blockchain using JavaScript

Cryptocurrency is a hot topic nowadays, especially since the value of Bitcoin has skyrocketed in the past two years. Though it is a volatile investment, many people still go for it.

Equally popular topic is the technology behind the cryptocurrency, i.e. the Blockchain. The appeal of the blockchain is that it can be applied to other industries other than cryptocurrency. The blockchain is a distributed ledger technology that provides a way to record and transfer data that is transparent, safe, auditable, and resistant to outages. The blockchain has the ability to make the organizations that use it transparent, democratic, decentralized, efficient, and secure.

In this article, we are keen to explore how JavaScript can be used to create a blockchain. There are many programming languages that are suitable to be used to write blockchain script, among them, VB.Net, Java, C++, Python, Solidity and of course, JavaScript.

Creating Animation in JavaScript

You can create an animation in JavaScript easily using the

setInterval method, the syntax is as follows:

myVariable=setInterval(myfunction, time interval)

The setInterval method runs a function created by you at a certain time interval in milliseconds. For example, a time interval of 1000 equals to 1 second.

Here are some examples of animations created by us:

The fromCharCode() Method

The fromCharCode() Method is a method that belongs to the String object in JavaScript. It converts a Unicode into a corresponding character. You can refer to the Unicode Table to look up for a certain Unicode for a certain character or symbol. For example,  The character of Unicode 78 is N.

Follow our JavaScript Tutorial Lesson 11 to learn more about the  fromCharCode() Method


Drawing a Quadratic Curve

To draw a quadratic curve, we use the quadraticCurve() method. However, we need to combine the quadraticCurve() method with the beginPath() and moveTo() methods in order to draw a quadratic curve. The beginPath() and moveTo() methods define the starting point of the quadratic curve. The quadraticCurve() method is to define the lowest point to the end point of the quadratic curve. The syntax of the quadraticCurve() method is

Please follow the following link to learn more.

Drawing a Quadratic Curve

Pythagoras Theorem

Pythagoras Theorem is used to solve problems related to the length of the sides of a triangle.
The formula to  is


AB  is the opposite side, AC is the adjacent and BC is the hypotenuse of a triangle ABC.

We shall create a JavaScript application to deal with problems related to Pythagoras Theorem. In this application, we shall insert two input boxes for the user to key in the length of the opposite side and the length of the adjacent side. The user can then click on the Calculate Hypotenuse button to find the answer.

Read more here