30秒学会 JavaScript 片段 – primes
Generates primes up to a given number, using the Sieve of Eratosthenes. Generate an array from 2 to ...
Generates primes up to a given number, using the Sieve of Eratosthenes. Generate an array from 2 to ...
Returns the sum of a list, after mapping each element to a value using the provided function. Use ma...
For testing purposes you might want to inject window.location object in your component. You can achi...
Returns true if the given DateTime is a weekday, false otherwise. Use DateTime.DayOfWeek to check if...
Creates an object composed of the properties the given function returns truthy for. The function is ...
Fetches all images from within an element and puts them into an array Use Element.prototype.getEleme...
Converts a number to a list of digits. Use map() combined with int on the string representation of n...
Groups the elements of an array based on the given function and returns the count of elements in eac...
Checks if the given argument is a function. Use typeof to check if a value is classified as a functi...
Creates a new string with the results of calling a provided function on every character in the calli...