Results for “Java”
Small, practical examples. Search by task or narrow things down below.
Run dependent async steps in order
JavaScript: Await one result before using it as the input of the next calculation.
JavaScript✓ Tested
Run your first program
Java: Start with a complete program that prints one line. Follow the run instructions below.
Java✓ Tested
Run your first program
JavaScript: Start with a complete program that prints one line. Follow the run instructions below.
JavaScript✓ Tested
Separate a first item from the remaining items
JavaScript: Array destructuring and a rest element produce named pieces of a sequence.
JavaScript✓ Tested
Serialize an object
Turn a JavaScript object into JSON text.
JavaScript✓ Tested
Sort a list
Sort a mutable Java list in natural ascending order.
Java✓ Tested
Sort numbers numerically
Supply a numeric comparator instead of JavaScript string sorting.
JavaScript✓ Tested
Sort timestamp strings by their parsed instants
JavaScript: Compare epoch values explicitly when date strings may contain different offsets.
JavaScript✓ Tested
Split an array into bounded batches
JavaScript: Advance by a positive batch size and allow a shorter final chunk.
JavaScript✓ Tested
Split and trim text
Split simple comma-separated JavaScript text and trim each part.
JavaScript✓ Tested
Split comma-separated text
Split a simple comma-separated string into individual Java values.
Java✓ Tested
Split text on several separator characters
JavaScript: A regex character class can recognize alternative simple delimiters.
JavaScript✓ Tested