Read the following JavaScript code and try to spot any mistakes: const favorites = {
tracks: [],
totalLength: 0,
}; function addToFavorites({ title, artist, album, length }) {
favorites.tracks.add({ title, artist, album, length });
favorites.totalLength = favorites.totalLength + track.length;
} const track = {
title: 'Bohemian Rhapsody',
artists…