enum StatusEnum {
accepted = "AC",
rejected = "RJ",
}
const select = (Object.keys(StatusEnum) as Array<keyof typeof StatusEnum>).map((x) => ({
value: x,
name: x + "_random",
}))
/**
* Console.log(select)
* [
* 0: { value: "accepted" , name: "accepted_random" }
* 1: { value: "rejected" , name: "rejected_random" }
* ]
*/
Is there a way to elegantly insert an object at the beginning of an array like this: { value: "all" , name: "all_random" } ?
/**
* Console.log(select)
* [
* 0: { value: "all" , name: "all_random" }
* 1: { value: "accepted" , name: "accepted_random" }
* 2: { value: "rejected" , name: "rejected_random" }
* ]
*/