Skip to main content
codingCourses
  • HTML
  • CSS
  • JavaScript
  • PHP
  • JS Tutorial
  • JS Strings
  • JS Arrays
JavaScript
  • JavaScript Tutorial
  • var, let, and const
    Key Differences Between Variable Declarations
  • Strict Mode
    Understanding "use strict"
  • Prototype Inheritance
    Understanding Prototype Inheritance
  • Spread Syntax
    A Simple Way to Spread and List Object Values
  • Rest Parameters
    Functions with Variable Arguments
  • Control CSS Variables with JavaScript
    How to Access and Modify Them
  • Arrow function Expressions
    Arrow Functions vs. Regular Functions
  • Immediately Invoked Function Expressions
    Why Use Them?
  • length Property
    Understanding and Usage
  • typeof Operator
    Checking Data Types
  • for...of Statement
    A Loop for Objects Iterable by Value
  • for...in Statement
    A Loop for Objects Iterable by Property (Key)
  • for...in vs. for...of Statements
    Key Differences Explained
  • URL Encoding Functions
    encodeURI() vs. encodeURIComponent()
  • encodeURI()
    Encoding an Entire URL
  • encodeURIComponent()
    Encoding URL Components
  • URL Decoding Functions
    decodeURI() vs. decodeURIComponent()
  • decodeURI()
    Decoding URLs Encoded with encodeURI()
  • decodeURIComponent()
    Decoding URL Components
  • HTMLCollection
    An Object Containing Selected HTML Elements
  • NodeList
    An Object Containing Selected Nodes
  • HTMLCollection vs. NodeList
    Understanding the Concepts and Differences
  • querySelector()
    Select the First Element Using a CSS Selector
  • querySelectorAll()
    Select All Elements Using a CSS Selector
  • querySelector() vs. querySelectorAll()
    Key Differences Explained
JavaScript Strings
  • JavaScript String Reference
  • Template Literals
    Handling Strings with Template Literals
  • trim()
    Leading and Trailing Whitespace
  • toLowerCase()
    Convert a String to Lowercase
  • toUpperCase()
    Convert a String to Uppercase
  • includes()
    Checking if a String Contains a Substring
  • indexOf()
    Find First Substring Index
  • search()
    Searching for Matching Strings Using Regexes
  • replace()
    Replacing Text in a String
  • slice()
    Slice a String by Index Range
  • split()
    Splitting a String and Returning an Array
  • substring()
    Extract a Substring
  • match()
    Finding Matches with Regular Expressions
JavaScript Arrays
  • JavaScript Array Reference
  • Array.isArray()
    Checking for Arrays
  • forEach()
    A function to loop through array elements
  • map()
    Ideal for mapping array data to new values
  • filter()
    Filter Elements with a Callback
  • find()
    Finding a First Element with a Callback
  • findIndex()
    Finding an Element's Index with a Callback
  • includes()
    Checking for an Element
  • indexOf()
    Find the First Index of an Element
  • slice()
    Extract Array Elements by Index Range
  • join()
    Joining Array Elements into a String
  • reduce()
    Reducing an Array to a Single Value
  • reverse()
    Reversing Original Array Elements
  • sort()
    Sorting Original Array Elements
  • concat()
    Concatenating Arrays or Arrays and Values
  • shift()
    Remove the First Element from an Array
  • pop()
    Remove the Last Element from an Array
  • unshift()
    Add Elements to the Start of an Array
  • push()
    Add Elements to the End of an Array

JavaScript Array Reference

JavaScript Next

Learn about JavaScript arrays and how to work with them.

JavaScript Array Reference
Array.isArray()
Checking for Arrays
The Array.isArray() function checks whether a given value is an array. It returns true if the input is an array; otherwise, it returns false.
forEach()
A function to loop through array elements
The JavaScript's forEach() function is a widely used and convenient method to loop through array elements and run a callback for each one. Explore the concepts and examples to master array processing.
map()
Ideal for mapping array data to new values
The JavaScript Array map() function creates a new array by applying a callback to each element. Learn the concept and explore practical examples to use it effectively.
filter()
Filter Elements with a Callback
The filter() function for arrays filters an array, keeping only the values that meet a specified condition. By providing a callback function, it returns a new array containing only the elements that satisfy the condition.
find()
Finding a First Element with a Callback
The find() function for arrays returns the first element that satisfies the condition defined by a callback function. If no element matches the condition, it returns undefined.
findIndex()
Finding an Element's Index with a Callback
The findIndex() function for arrays returns the index of the first element that satisfies the condition defined by a callback function. If no element matches the condition, it returns -1.
includes()
Checking for an Element
The includes() function for arrays checks whether a given array contains a specified element and returns true if it does, or false otherwise.
indexOf()
Find the First Index of an Element
The indexOf() function for arrays returns the index of the first found (occurrence of the) specified element. If the element is not found, it returns -1.
slice()
Extract Array Elements by Index Range
The slice() function for arrays extracts a portion of an array using an index range and returns a new array without modifying the original.
join()
Joining Array Elements into a String
The join() function for arrays joins each element of a given array using a specified separator and returns a single string.
reduce()
Reducing an Array to a Single Value
The reduce() function for arrays iterates through an array using a callback function to repeatedly reduce it to a single value. The original array remains unchanged.
reverse()
Reversing Original Array Elements
The reverse() function for arrays reverses the order of the elements, turning the first element into the last and the last element into the first.
sort()
Sorting Original Array Elements
The sort() function for arrays returns the original array after sorting its elements; by default, it sorts according to the Unicode code point order of strings, and a custom sorting criteria can be specified through a callback function.
concat()
Concatenating Arrays or Arrays and Values
The concat() function for arrays concatenates one or more arrays or values in order to create a new array. Each element or value is appended to the end of the previous array, and the function returns the concatenated array without modifying the original.
shift()
Remove the First Element from an Array
The shift() function removes the first element from an array and returns it. This operation decreases the array's length by one.
pop()
Remove the Last Element from an Array
The pop() function removes the last element from an array and returns it. This operation decreases the array length by one.
unshift()
Add Elements to the Start of an Array
The unshift() function prepends one or more elements to the beginning of an array—similar to inserting items at the front. This also increases the array's length.
push()
Add Elements to the End of an Array
The push() function adds one or more elements to the end of an array—essentially 'pushing' them onto it, like stacking items. This also increases the array's length.
JavaScript Next

codingCourses offers coding tutorials made for everyone.
All materials and examples are continuously reviewed to prevent errors; however, complete accuracy cannot be guaranteed.
Therefore, please carefully test and review all materials and examples to ensure they are free of errors, bugs, or vulnerabilities before relying on them.
They are available under the Creative Commons Attribution 4.0 International

Copyright © codingCourses. All Rights Reserved.