Skip to main content
codingCourses
  • HTML
  • CSS
  • JavaScript
  • PHP
  • JS Tutorial
  • JS Strings
  • JS Arrays
  • JS URL Encoding & Decoding
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
  • 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 URL
  • URL Encoding & Decoding
  • 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

JavaScript URL Encoding & Decoding

JavaScript Next

Learn how to encode and decode URLs in JavaScript.

JavaScript URL Encoding & Decoding
URL Encoding Functions
encodeURI() vs. encodeURIComponent()
JavaScript provides two functions for URL encoding: encodeURI() and encodeURIComponent(). In this guide, we'll compare their purposes and highlight the key differences between them.
encodeURI()
Encoding an Entire URL
The encodeURI() function encodes a URL except for certain special characters that define its structure. It is primarily used to encode entire URL strings.
encodeURIComponent()
Encoding URL Components
The encodeURIComponent() function is used to safely encode characters in specific parts of a URL, such as query parameters, file names, or search terms.
URL Decoding Functions
decodeURI() vs. decodeURIComponent()
JavaScript provides two functions for URL decoding: decodeURI() and decodeURIComponent(). In this guide, we'll compare their purposes and highlight the key differences between them.
decodeURI()
Decoding URLs Encoded with encodeURI()
The decodeURI() function is used to decode a URL that was encoded using encodeURI(). It decodes only the special characters encoded by encodeURI().
decodeURIComponent()
Decoding URL Components
The decodeURIComponent() function is used to decode a URL that was encoded using encodeURIComponent(). It decodes only the special characters encoded by encodeURIComponent().
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.