I have this method for sorting an array of objects, but when I have a complex structure, for example:
const data = [ { title: \'Book title\', author: \'John\',