<script>
	const arr = [1, 2];
	[arr, arr[1]] = [arr[1], arr[0]];
</script>

{arr}