If the provided value is an array, returns the first element. Otherwise, returns the value itself.
Optional
Use const [first] = [1, 2, 3] instead.
const [first] = [1, 2, 3]
If the provided value is an array, returns the first element. Otherwise, returns the value itself.