30秒学会 JavaScript 片段 – isString
Checks if the given argument is a string. Only works for string primitives. Use typeof to check if a...
Checks if the given argument is a string. Only works for string primitives. Use typeof to check if a...
Returns true if the given string is a palindrome, false otherwise. Convert the string to String.prot...
Maps the values of a list using a function, where the key-value pairs consist of the value as the ke...
Checks if a string is upper case. Convert the given string to upper case, using string.ToUpper() and...
Returns the memoized (cached) function. Create an empty cache by instantiating a new array. Return a...
Iterates over all own properties of an object, running a callback for each one. Use Object.keys(obj)...
Returns true if the user color scheme preference is dark, false otherwise. Use window.matchMedia() w...
Flattens a list, by spreading its elements into a new list. Loop over elements, use list.extend() if...
Tests a value, x, against a predicate function, conditionally applying a function. Check if the valu...
Reverses a string. Use string.ToCharArray() to convert the string to an array of char, Array.Reverse...