Is it possible to sort an array of objects in JavaScript while specifying the first element? Here's an example:
Initial data in JavaScript
{title: 'test 1', text: 'aa'},
{title: 'test 2', text: 'bb'},
{title: 'display first', text: 'this is an example'},
{title: 'test 4', text: 'dd'}
After sorting
var elementToDisplayFirst = "display first";
{title: 'display first', text: 'this is an example'},
{title: 'test 1', text: 'aa'},
{title: 'test 2', text: 'bb'},
{title: 'test 4', text: 'dd'}
Thank you!