As a newcomer to Typescript, I am looking to create a function that can modify an object by filtering out certain information.
Consider the following Type definition:
type movie = {id: number, title:string, url:string, rating:number}
I need a function that takes an array of movies as input and outputs the same array but only with id and title included.
For example, if the input is:
[{id:1, title:Wonder Woman, url: www, rating:5},{id:2, title: Super Man, url:www2, rating:7}]
The desired output should be:
[{id:1, title:Wonder Woman},{id:2, title: Super Man}]
Are there any straightforward methods to achieve this?