I have an array of objects in javascript:
shapeToolsTarget: Array(4)
0: {id: 20, name: "Background", type: "shape"}
1: {id: 21, name: "BorderColor", type: "shape"}
2: {id: 22, name: "BorderWeight", type: "shape"}
3: {id: 3, name: "Paste", type: "text"}
How I can rearrange the last element of an array to the first place? Like that:
shapeToolsTarget: Array(4)
0: {id: 3, name: "Paste", type: "text"}
1: {id: 20, name: "Background", type: "shape"}
2: {id: 21, name: "BorderColor", type: "shape"}
3: {id: 22, name: "BorderWeight", type: "shape"}