How to convert pages in main.js file to pages object in app.json

use javascript to convert ["pages/logs/main"," ^ pages/index/main", "pages/counter/main"] to
[
    "pages/index/main",
    "pages/counter/main",
    "pages/logs/main"
]

description: raise the item ^ pages/index/main to the front of the array and remove ^

var pages =["pages/logs/main", "^pages/index/main", "pages/counter/main"] 
var startPageIndex = pages.findIndex(v => { return v[0] === "^"})
var startPage = pages[headIndex].slice(1)
pages.splice(startPageIndex, 1)
pages.unshift(startPage)
console.log(pages)

is there a more streamlined operation than this, gods?

Mar.28,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38463-2c0f3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38463-2c0f3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?