Fix typos
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
Use recursion.
|
||||
Use `Array.concat()` with an empty array (`[]`) and the spread operator (`...`) to flatten an array.
|
||||
Rrecursively flatten each element that is an array.
|
||||
Recursively flatten each element that is an array.
|
||||
|
||||
```js
|
||||
const deepFlatten = arr => [].concat(...arr.map(v => Array.isArray(v) ? deepFlatten(v) : v));
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
### Shallow clone object
|
||||
|
||||
Use `Object.assign()` and an empty object (`{}`) to create a shallo clone of the original.
|
||||
Use `Object.assign()` and an empty object (`{}`) to create a shallow clone of the original.
|
||||
|
||||
```js
|
||||
const shallowClone = obj => Object.assign({}, obj);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
### Validate email
|
||||
|
||||
Use a regular experssion to check if the email is valid.
|
||||
Use a regular expression to check if the email is valid.
|
||||
Returns `true` if email is valid, `false` if not.
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user