Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const data = [
- {
- title: "Chapter 10",
- },
- {
- title: "Chapter 1",
- },
- {
- title: "Chapter 2",
- },
- ];
- let hasil;
- data.forEach((title) => {
- const da = data.sort(
- (a, b) =>
- a.title.substring(a.title.indexOf(" ") + 0).trim() -
- b.title.substring(b.title.indexOf(" ") + 0).trim()
- );
- hasil = da;
- });
- console.log(hasil);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement