DONATE  
MENU
AJAX
JAVASCRIPT
HTML
JSON

JavaScript Tutorials

INTRODUCTION

» Introduction to JavaScript

» Practice IT Editor

» JavaScript Example

» JavaScript Placement

» JavaScript Syntax

» JavaScript Statements

» JavaScript Input

» JavaScript Output

» JavaScript Comments

» JavaScript Variables

» Variables' Scope

» JavaScript Operators

» JS Expressions & Concatenation

» JavaScript Data Type

» JavaScript Numbers

» Number Object

» JavaScript Strings

» String Object

» JavaScript Booleans

» Boolean Object

» JavaScript Functions

» JavaScript Arrays

» Array Object - Properties

» Array Object - Methods

» JavaScript Objects

» JavaScript Undefined

» JavaScript Nulls

CONDITIONAL TESTING

» If Statement

» If Else Statement

» JavaScript Ternary Operator

» Switch Statement

LOOPS

» For Loops

» While Loops

» Break & Continue

» For...In Loops

» do...while Loop

FUNCTIONS

» JavaScript Functions

» Creating Functions

» Functions' Parameters

» Functions' Arguments

» Function Invocation

» The Return Keyword

» The Arguments Object

» Callback Functions

» Arrow Functions

ARRAYS

» JavaScript Arrays

» Creating Arrays

» Accessing Arrays

» Looping Arrays

» Multi - dimensional Arrays

OBJECTS

» JavaScript Objects

» Creating Objects

» Prototype Definition

» Accessing Objects

» The this Keyword

AJAX

» Introduction to AJAX

JSON

» Introduction to JSON

JAVASCRIPT DATES

» The Date Object

» Date Methods

» Timing (SetInterval & SetTimeout)

MATH OBJECT

» Math Object

» Math Methods

HTML / JS DOM

» DOM Introduction

» Accessing HTML Elements in DOM

» Get And Change Elements' Contents & Values

» Change Styling - DOM CSS

» DOM Attributes

» JavaScript Event Listeners

» DOM Event Listeners

» JS Events

MISCELLANEOUS

» JS Strict Mode

» JavaScript Hoisting

» JavaScript let keyword

» Reserved Keywords

» JS Best Practices

» JavaScript vs ECMAScript

JAVASCRIPT EXAMPLES

» JavaScript Calculator

.. » JavaScript » Arrays » JavaScript Arrays
Share Tweet WhatsApp

JavaScript Arrays

An array is a value that comprises of multiple values of other data types. Such values can be access using an index number. Usually, a variable or data type carries one value,
23;
true;
"StackBeginner.com";
var x = 1;
but an array on the other hand can hold more than one value of any data type including other arrays,
var myArray = [number, string, boolean, array, object, function];

var myArr = [200, "Okay", true, [1, "confirmed"], {"state":"okay"}, function okay(){}];
Above, we can see an example of an array containing multiple values of various data types. First, a number - 200. Second, a string - "Okay". Third, a boolean - true. Fourth, an array - [1, "confirmed"]. Fifth, an object - {"state":"okay"}. Sixth, a function - function okay(){}. Arrays are very powerful data types in not just JavaScript but most programming languages. It is hopeful that at the end of this chapter, you will be acquainted with working with arrays in your web application. SUMMARY
  1. We are usually familiar with values and variables being one. Even when a JavaScript expression brings two or more variables together using operators, the result still returns one value.
  2. But arrays changes that perspective as they are a special kind of data type that can contain one or more values at the same time.
  3. These values can comprise of just any data type including other arrays.
  4. We thereafter get or access these individual values using an index number.
Take a short quiz on JavaScript Arrays.
Ask a question or tell us if JavaScript Arrays is easy or not.
cent?

Join our 1,090 subscribers to receive tutorials' updates!

  We won't spam your mail box. We hate it.





StackBeginner 2021 © Joseph Omamode