Is there a way to grab only the first four characters of a date string from an API in JavaScript?
Back story
I am using The Movie Database, which allows me to get the exact release dates of movies. For instances, I get the following object of data for "Finding Nemo":
I've added the following code in my Movies.js component, <p>({movie.release_date})</p>
and it returns 2003-05-30 as expected.
But is there a way to extract only the first four characters (2003) and return only that? Or better yet, is there a way to extract only the release year?