Skip to content

Tag: javascript

prioritize pushing element to array

I have an array with objects as elements. What I did was check if the titles value contains a certain string and it it does push that a new array and log the new array and the process works. What I want is when pushing to the new array I want to prioritize the string found first to be pushed