• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
JavaScriptSource

JavaScriptSource

Search 5,000+ Free JavaScript Snippets

  • Home
  • Browse Snippets
    • Addon
    • Ajax
    • Buttons
    • Cookies
    • CSS
    • Featured
    • Forms
    • Games
    • Generators
    • Image Effects
    • Math Related
    • Miscellaneous
    • Multimedia
    • Navigation
    • Page Details
    • Passwords
    • Text Effects
    • Time & Date
    • User Details
Home / Archives for Miscellaneous

Miscellaneous

Filter out matching array elements

Filter out matching array elements

Filters out the elements of an array that have one of the specified values.

Miscellaneous

Count elements in an array

Count elements in an array

Two ways to count the total number of the same elements in a single array.

Miscellaneous

Create a new array from an existing one

Create a new array from an existing one

Create a new array from an existing one, or transform an array-like object (like a NodeList) into an array.

Miscellaneous

Capitalize the first letter of every word in a string

Capitalize the first letter of every word in a string

Use String.prototype.replace() to match the first character of each word and String.prototype.toUpperCase() to capitalize it.

Miscellaneous

Get unique values in an array

Get unique values in an array

Source https://github.com/JSsnippets/JavaScript-snippets

Miscellaneous

Delete, replace, and add items to an array at specific indexes

Delete, replace, and add items to an array at specific indexes

The Array.splice() method accepts three arguments: start, delete, and items. The first, start, is the index of the item you want to modify in the array. It’s the only required argument. The second, delete, is the number of items to delete from the array. If you omit this argument, the Array.splice() method will remove every item from the start index on. If you set it to 0, […]

Miscellaneous

Two ways to remove a specific item in an array

Two ways to remove a specific item in an array

Remove a specific item in an array either the mutating way or the non-mutating way. Source https://github.com/JSsnippets/JavaScript-snippets

Miscellaneous

Copy a segment of an array into a new array

Copy a segment of an array into a new array

The first argument is the array index to start at, and the second is the index to end on.

Miscellaneous

Check if the given string is an absolute URL

Check if the given string is an absolute URL

Use RegExp.prototype.test() to test if the string is an absolute URL.

Miscellaneous

Find the difference between two arrays with JavaScript

Find the difference between two arrays

Compare two arrays and display the difference between the two.

Miscellaneous

  • « Go to Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 6
  • Go to page 7
  • Go to page 8
  • Go to page 9
  • Go to page 10
  • Interim pages omitted …
  • Go to page 16
  • Go to Next Page »

Primary Sidebar

Popular Posts

Story Generator

IP Grabber – get a users IP address with JavaScript

Simple Calendar

Remove Ads

Astrological Calculator

Copyright © 2025 JavaScriptSource.com

  • About
  • Privacy Policy
  • FAQ
  • Jobs For Developers