Write a function named searchMessages that receives 2 parameters:
messages, each with 2 properties:body - the text inside the messagesentAt - a Date representing when the message was sentsearchTermThe function should find all messages that match the searchTerm. A message matches it if:
bodybodyThen return all those messages in descending order based on:
searchTerm they matchsentAt property (newest first)NOTE: the search is not case sensitive
messages
=searchTerm
=