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 String Reference

JavaScript Next

Learn about JavaScript strings and how to work with them.

JavaScript String Reference
Template Literals
Handling Strings with Template Literals
Learn how to use JavaScript template literals (backticks) for string manipulation, including multiline strings, variable interpolation, expressions, and dynamic URL creation with practical examples.
trim()
Leading and Trailing Whitespace
The trim() function removes whitespace from both ends of a given string and returns a new string without modifying the original string.
toLowerCase()
Convert a String to Lowercase
The toLowerCase() function returns the given string converted to lowercase. Since it only returns the converted string, the original string remains unchanged.
toUpperCase()
Convert a String to Uppercase
The toUpperCase() function returns the given string converted to uppercase. Since it only returns the converted string, the original string remains unchanged.
includes()
Checking if a String Contains a Substring
The includes() function for strings checks whether a given string contains a specified substring and returns true if it does, or false otherwise.
indexOf()
Find First Substring Index
The indexOf() function for strings returns the index of the first occurrence of the specified substring. If the specified substring is not found, it returns -1.
search()
Searching for Matching Strings Using Regexes
The search() function for strings searches for a match between a regular expression and a string, returning the index (integer) of the first match.
replace()
Replacing Text in a String
The replace() function for strings returns a new string where one or more occurrences of a specific substring or a regular expression pattern are replaced by a specified replacement.
slice()
Slice a String by Index Range
The slice() function for strings slices a string by an index range and returns a new string without modifying the original string.
split()
Splitting a String and Returning an Array
The split() function splits a given string based on a specified delimiter or a regular expression and returns a new array.
substring()
Extract a Substring
The substring() function extracts a specific portion of a string. It returns a new string from the specified start index up to, but not including, the end index.
match()
Finding Matches with Regular Expressions
The match() function for strings uses a regular expression to find parts of a given string that match and returns the result.
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.