JavaScript arrays are used to store multiple values in a single variable. An array is a special variable, which can hold more than one value at a time.

Creating an Array


var array_name = [item1, item2, …];

Spaces and line breaks are not important. A declaration can span multiple lines:

var cities= [
var cities = new Array("Moscow", "Berlin", "München");

The two examples above do exactly the same. There is no need to use new Array() . For simplicity, readability and execution speed, use the first one (the array literal method).

Methods of Array

The strength of JavaScript arrays lies in…

If you haven’t read the first part, click here.

The pop() method removes the last element from an array and returns that element. This method changes the length of the array. Syntax: arr.pop(). If you call pop() on an empty array, it returns undefined.

Data types specify what kind of data can be stored and manipulated within a program. In JavaScript, data types are divided into two parts. Primitive data types and Reference data types. These data types are subdivided into several types.

Primitive data types are string, number, boolean, null, undefined, symbol. As you know, strings are used to express texts. numbers are used to denote numbers, booleans are used to denote “true” and “false”, nulls are used to denote that a variable “has no value”, undefined are used to denote indefinite variables, and symbols are used to denote symbols.

Reference data types…

One of the most interesting topics for beginners in Javascript is features. It is used for notification or confirmation of transactions.

In this article I will talk about the most frequently used functions in javascript: “alert”, “prompt”, “confirm”.

What is the alert function?

It is mainly used to show users a message, ie a kind of warning. For example:

alert (“Hello World!”);

And our output will be as follows:

If you haven’t read the first part, click here.

Math.ceil() Method

The Math.ceil() function always rounds a number up to the next largest integer.

Example 1.

Part 1

JavaScript Operators use either value or variable to compute some task. This lesson describes the JavaScript operators with example, and operators precedence.

Arithmetic Operators

JavaScript arithmetic operator take operand (as a values or variable) and return the single value.

With this operator, we can add two or more values. For example:

Pi is a crypto asset created based on the stellar platform. The platform opens to the community during the beta process, and although mining is not normally available on the Stellar platform, it allows the sharing of this digital asset, which is produced by simulating mining with the developments it offers, with a meritocracy-based distribution model. You can earn Pi on the platform with three different roles. Pioneer, Contributor, and Ambassador.

As with most other mined cryptocurrencies, there is a halving in Pi. The halving trigger is the number of members. Each time the number of current members reaches a…

Basic image slideshow

As you know, a slideshow is made up of several images and videos changing over time. So how do you create a simple image slideshow using Javascript?

First, we enter our IMG tag in the HTML section.

Then we give it name , width and height . These values ​​may change depending on your wishes. Now, we select the images to use in the slideshow according to the dimensions we have specified in the img tag. If you have difficulty finding a picture, you can find pictures of the desired size on the Internet. …

What is a cryptocurrency?

Cryptocurrencies are completely digital, encrypted virtual currencies used in currency exchange. Some analysts even call cryptocurrencies the money of the future. Currently, with the devaluation of the state currency in some countries, cryptocurrencies have become the state currency.

What are the advantages of cryptocurrencies?

The biggest advantage of cryptocurrencies is that they do not depend on state banks. This means that it does not depend on the economic situation. Another advantage is that someone else can’t freeze your currency account and seize the account.

Today, with the rapid appreciation of bitcoin, people’s interest in cryptocurrencies has…

Bildiyiniz kimi Javascript dünyada geniş istifadə edilməyə başlayan, və populyarlığını daha da artıran proqramlama dilidir. Ötən illərdə ES6 standartları ilə bu dilə yeni keywords- lər : let və const daxil oldu. Bu məqalədə sizlərə let və const- un var ilə olan fərqindən bəhs edəcəm.

Var keyword.

Var- keyword- ü bizə tanımlanan bir dəyişənin fərqli yerlərdə bir neçə dəfə tanımlanmasınaimkan verir. Hətta o block statements- də olsa belə sonda özünü global scope olaraq aparır.

var a = 5;
a = 10;
console.log(“Final value is- “, a);
// Final value is- 10

var a = 15;
var a = “Fifty Five”;
//Fifty Five


Full-Stack developer. Founder of The-Black. Editor of Star Gazers publication. BEU

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store