Removed swap
This commit is contained in:
12
README.md
12
README.md
@ -121,7 +121,6 @@
|
||||
* [Random integer in range](#random-integer-in-range)
|
||||
* [Random number in range](#random-number-in-range)
|
||||
* [RGB to hexadecimal](#rgb-to-hexadecimal)
|
||||
* [Swap values of two variables](#swap-values-of-two-variables)
|
||||
* [URL parameters](#url-parameters)
|
||||
* [UUID generator](#uuid-generator)
|
||||
* [Validate email](#validate-email)
|
||||
@ -1367,17 +1366,6 @@ const rgbToHex = (r, g, b) => ((r << 16) + (g << 8) + b).toString(16).padStart(6
|
||||
|
||||
[⬆ back to top](#table-of-contents)
|
||||
|
||||
### Swap values of two variables
|
||||
|
||||
Use array destructuring to swap values between two variables.
|
||||
|
||||
```js
|
||||
[varA, varB] = [varB, varA];
|
||||
// [x, y] = [y, x]
|
||||
```
|
||||
|
||||
[⬆ back to top](#table-of-contents)
|
||||
|
||||
### URL parameters
|
||||
|
||||
Use `match()` with an appropriate regular expression to get all key-value pairs, `Array.reduce()` to map and combine them into a single object.
|
||||
|
||||
Reference in New Issue
Block a user