• 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

Finding a specific object in an array of objects

Finding a specific object in an array of objects

Iterating through an array of objects to find a specific one.

Miscellaneous

Drag and drop element in a list

Drag and drop element in a list

Create a sortable list whose items can be dragged and dropped inside it.

Miscellaneous

Convert a string into an array

Convert a string into an array

Convert a string into an array by splitting it after a specific character (or characters).

Miscellaneous

Check if the given string contains any whitespace characters

Check if the given string contains any whitespace characters

Use RegExp.prototype.test() with an appropriate regular expression to check if the given string contains any whitespace characters.

Miscellaneous

Replace a portion of a string with something else

Replace a portion of a string with something else

The replace() method accepts two arguments: the string to find, and the string to replace it with.

Miscellaneous

Transform all text in a string to lowercase

Transform all text in a string to lowercase

Use String.toLowerCase() to transform all text in a string to lowercase.

Miscellaneous

Check if an Item Exists in an Array

Check if an Item Exists in an Array

Instead of using the indexOf() method to check if an element is in the array, you can use the includes() method.

Miscellaneous

Return all the elements of an array except the last one

Return all the elements of an array except the last one

Use Array.prototype.slice(0, -1) to return all but the last element of the array.

Miscellaneous

Show a loading indicator when an iframe is being loaded

Show a loading indicator when an iframe is being loaded

This post demonstrates a common case where we show a loading indicator while an iframe is being loaded.

Miscellaneous

Remove leading and trailing whitespace from a string

Remove leading and trailing whitespace from a string

Remove leading and trailing whitespace from a string.

Miscellaneous

  • « Go to Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 8
  • Go to page 9
  • Go to page 10
  • Go to page 11
  • Go to page 12
  • 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