JAVASCRIPT SNIPPETS

The following applications have been developed using JavaScript and HTML.

Access Numbers in a Table
This example converts and sum up numeric values in an HTML table and then insert a table row with this sum.

Apply a Function Against Each Array Element
This example applies a function against each array element.

Build Array of DOM Elements
This element builds an array of DOM elements.

Check for an Existing, Nonempty String
This example checks for an existing, nonempty string.

Concatenate Data Types
This example concatenates data types.

Concatenate Strings
This example concatenates strings.

Conditionally Comparing Strings
This example conditionally comparing strings.

Convert a Decimal Array to Hex
This example converts a decimal array to hex.

Convert a Decimal Value to a Hex Value
This example converts a decimal value to a hex value.

Convert ISO 8601 Date
This example converts an ISO 8601 date.

Create a Filtered Array
This example creates a filtered array.

Create a Future Date
This example creates a future date.

Create a New Array as a Subset of an Existing Array
This example creates a new array as a subset of an existing array.

Create a Random Color Generator
This example creates a random color generator.

Create a Random Number Generator
This example creates a random number generator.

Create a Specific Date
This example creates a specific date.

Create a String from an Array
This example creates a string from an array.

Create Recurring Timers
This example creates recurring timers.

Create Time Out
This example creates a time out.

Extract a Substring from a String
This example extracts a substring from a string.

Find a Substring in a String
This example finds a substring in a string.

Find and Highlight All Instances of a Pattern
This example finds and highlights all instances of a pattern.

Flatten a Multidimensional Array
This example flattens a multidimensional array.

Function Closers with Timers
This example shows function closers with timers.

Get Index of an Array
This example gets the index of an array.

Inserting Special Characters
This example inserts special characters.

JavaScript Method Split
This example performs the JavaScript method Split.

Keep an Incremental Counter
This example keeps an incremental counter.

Left- or Right-Pad a String
This example performs a left or right pad on a string.

Loop Through an Array
This example loops through an array.

Pattern Matching on Arrays
This example performs pattern matching on arrays.

Print Out an ISO 8601 Formatted Date
This example prints out an ISO 8601 formatted date.

Print Out Today’s Date
This example prints out today’s date.

Print Out UTC Date & Time
This example prints out UTC date and time.

Process Individual Lines of a Textarea
This example processes individual lines of a Textarea.

Push & Pop Array Values
This example performs push and pop on array values.

Push & Shift Array Values
This example performs push and shift on array values.

Remove & Splice Array Elements
This example removes and splices array elements.

Replace & Delete Elements in an Array
This example replaces and deletes elements in an array.

Replace HTML Tags with Named Entities
This example replaces HTML tags with named entities.

Search for Special Characters
This example searches for special characters.

Sort Array
This example sorts an array.

Swap Words in a String Using Capturing Parentheses
This example swaps words in a string using capturing parentheses.

Test for Case-Insensitive Substring Matches
This example tests for case-insensitive substring matches.

Test Whether a Substring Exists
This example tests whether a substring exists.

Track Elapsed Time
This example tracks elapsed time.

Trim Whitespace from the Ends of a String
This example trims whitespace from the ends of a string.

Use Math method to Fit a Circle
This example uses math method to fit a circle.

Using Regular Expressions to Trim Whitespace
This example uses regular expressions to trim whitespace.

Validate a Social Security Number
This example validated a social security number.

Validate Array Contents
This example validates array contents.


© 1997-2021    Codehacker - All Rights Reserved