New member
- Joined
- Feb 9, 2023
- Messages
- 4
- Thread Author
- #1
I need help determining the best way to extract the price value out of the strings in the array received from the API, and then reorder the array based on the lowest price values.
These are some of the data that I received from the API.
The outcome should look like this.
These are some of the data that I received from the API.
Code:
let luxcar_data = ["Ferrari70", "Bugatti45", "McLaren17", "Lamborghini41", "Rolls52", "Aston30", "Koenigsegg19", "Pagani28", "Lamborghini36", ...];
Code:
[{name: "McLaren", price: 17}, {name: "Koenigsegg, price: 19}, .... , {name: "Ferrari", price: 70}]