Travis build: 771 [ci skip]
This commit is contained in:
13
README.md
13
README.md
@ -3658,7 +3658,7 @@ Replaces all but the last `num` of characters with the specified mask character.
|
||||
|
||||
Use `String.slice()` to grab the portion of the characters that need to be masked and use `String.replace()` with a regex to replace every character with the mask character.
|
||||
Concatenate the masked characters with the remaining unmasked portion of the string.
|
||||
Omit the second argument, `num`, to keep a default of `4` characters unmasked.
|
||||
Omit the second argument, `num`, to keep a default of `4` characters unmasked. If `num` is negative, the unmasked characters will be at the start of the string.
|
||||
Omit the third argument, `mask`, to use a default character of `'*'` for the mask.
|
||||
|
||||
```js
|
||||
@ -4186,15 +4186,14 @@ isArray([1]); // true
|
||||
|
||||
Checks if the provided argument is array-like (i.e. is iterable).
|
||||
|
||||
Check that the object is not a function or `null` and that its `length` property is a non-negative integer below `Number.MAX_SAFE_INTEGER`.
|
||||
Use the spread operator (`...`) to check if the provided argument is iterable inside a `try... catch` block and the comma operator (`,`) to return the appropriate value.
|
||||
|
||||
```js
|
||||
|
||||
const isArrayLike = val =>
|
||||
val != null &&
|
||||
typeof val != 'function' &&
|
||||
val.length > -1 &&
|
||||
val.length % 1 == 0 &&
|
||||
val.length <= Number.MAX_SAFE_INTEGER;
|
||||
try {return [...val], true; }
|
||||
catch (e) { return false; }
|
||||
};
|
||||
```
|
||||
|
||||
<details>
|
||||
|
||||
Reference in New Issue
Block a user