Update 12_day_regular_expressions.md

pull/320/head
yendoz 3 years ago committed by GitHub
parent f5b44976f6
commit 9acb2cdbcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -430,9 +430,9 @@ console.log(result) // true
1. The position of some particles on the horizontal x-axis -12, -4, -3 and -1 in the negative direction, 0 at origin, 4 and 8 in the positive direction. Extract these numbers and find the distance between the two furthest particles.
```js
points = ['-1', '2', '-4', '-3', '-1', '0', '4', '8']
sortedPoints = [-4, -3, -1, -1, 0, 2, 4, 8]
distance = 12
points = ['-12', '-4', '-3', '-1', '0', '4', '8']
sortedPoints = [-12, -4, -3, -1, 0, 4, 8]
distance = 20
```
1. Write a pattern which identify if a string is a valid JavaScript variable

Loading…
Cancel
Save