Let’s say I Got an array of objects Like this:
let array = [
{Course: “A”, Week: “3”},
{Course: “B”, Week: “5”},
{Course: “”, Week: “”},
{Course: “”, Week: “”},
{Course: “”, Week: “”},
]
How Can I modify this array so the obejcts is place in the array based on the value of Week? E.g obejct with value 3 in Week Will be third element (index 2) in the array? In other Words swap place with the element on that index?