// dont forget to add const or let'
[array[0], array[2]] = [array[2], array[0]]
for let array = [23, 34, 45];you would have something like this
// let arr = ['foo', 'bar']
/*
'''
instead of assigning a single variable name
you can assign a variable name for each item in the array
eg.
let a = 'foo'
let b = 'bar'
to do this from the array you would say
let a = arr[0] // 'foo'
let b = arr[1] // 'bar'
a nicer looking way to say this exact same thing is to
just name each item like every other variable, but you put
them before the = sign
'''
*/
let [a,b] = ['foo', 'bar'] // returns a as 'foo' and b as 'bar'