Snippets tagged “reduce”
7 snippets use this tag.
- How are lambdas useful?Python
Lambdas, also known as anonymous functions, are useful in Python because they allow you to create small, one-time use functions without having to define them with a full function statement.
- How to Check for the Existence of Nested JavaScript Object KeyJavaScript
In this tutorial, you will find several methods that are used to test the existence of the nested JavaScript object keys. Also, find how to avoid TypeError.
- How to Find the Min/Max Elements in an Array in JavaScriptJavaScript
Read this JavaScript tutorial and learn about the methods used to find the minimum and maximum number of elements in an array. Find the fastest solution.
- How to Find the Sum of an Array of NumbersJavaScript
Read this JavaScript tutorial and learn several methods used to find or calculate the sum of an array of numbers. Also, find which is the fastest one.
- How to Sort JavaScript Object by KeyJavaScript
In this JavaScript tutorial, you will read and learn information about a functional method of sorting an object by key supported by all major browsers.
- How to sum a list of integers with java streams?Java
You can use the reduce() operation in the Java Streams API to sum the elements of a list of integers.
- Using streams to convert a list of objects into a string obtained from the toString methodJava
You can use the map and collect methods of the Stream class to achieve this.