• 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

Determine whether two values are the same value

Determine whether two values are the same value

The Object.is() method determines whether two values are the same value.

Miscellaneous

Take the content of an array and return a single value

Take the content of an array and return a single value.

Take the content of an array and return a single value. That value can be anything: a string, number, object, or even another array.

Miscellaneous

Remove whitespaces from a string

Remove whitespaces from a string

Returns a string with whitespaces removed. Use String.prototype.replace() with a regular expression to replace all occurrences of whitespace characters with an empty string.

Miscellaneous

Aliases with JavaScript Destructuring

Aliases with JavaScript Destructuring

There are cases where you want the destructured variable to have a different name than the property name.

Miscellaneous

Transform the items in an array and create a new one

Transform the items in an array and create a new one

Iterate through each item in an array, transform it, and return a new array.

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

  • « Go to Previous Page
  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to page 4
  • Go to page 5
  • Interim pages omitted …
  • Go to page 28
  • Go to Next Page »

Primary Sidebar

FREE UPDATES!

Get the latest updates in your inbox for FREE!

Popular Posts

Story Generator

IP Grabber

Simple Calendar

Remove Ads

Astrological Calculator

Copyright © 2022 JavaScriptSource.com

  • About
  • Privacy Policy
  • Submit
  • FAQ
  • Jobs For Developers
  • Contact Us